From 59db3ab59a7631ae99a2af4e9ea5e5becac8b2e3 Mon Sep 17 00:00:00 2001 From: Mortdecai Date: Thu, 26 Mar 2026 19:22:16 -0400 Subject: [PATCH] fix: make help tab read-only (stty -echo -icanon) --- sethmux-help.sh | 7 +++++-- sethmux-start.sh | 1 + 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/sethmux-help.sh b/sethmux-help.sh index 95a57f1..8b83d4c 100755 --- a/sethmux-help.sh +++ b/sethmux-help.sh @@ -1,7 +1,10 @@ #!/bin/bash # sethmux cheat sheet — runs in the persistent help tab +# Read-only: all keyboard input is silently consumed # Redraws on terminal resize via trap +stty -echo -icanon 2>/dev/null + draw() { clear COLS=$(tput cols) @@ -75,5 +78,5 @@ draw() { trap draw WINCH draw -# Stay alive, redraw on resize -while true; do sleep 86400; done +# Read-only: consume all stdin silently, redraw on resize +while IFS= read -r -s -n 1 -t 86400 _ 2>/dev/null; do :; done diff --git a/sethmux-start.sh b/sethmux-start.sh index 20534fe..852b2bc 100755 --- a/sethmux-start.sh +++ b/sethmux-start.sh @@ -12,6 +12,7 @@ tmux new-window -t "$SESSION" -n "git" tmux new-window -t "$SESSION" -n "run" tmux new-window -t "$SESSION" -n "logs" tmux new-window -t "$SESSION" -n "help" "/opt/sethmux/sethmux-help.sh" +tmux set-option -t "$SESSION:help" -p remain-on-exit on tmux select-window -t "$SESSION:1" # Ensure logs dir exists