fix: make help tab read-only (stty -echo -icanon)
This commit is contained in:
+5
-2
@@ -1,7 +1,10 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
# sethmux cheat sheet — runs in the persistent help tab
|
# sethmux cheat sheet — runs in the persistent help tab
|
||||||
|
# Read-only: all keyboard input is silently consumed
|
||||||
# Redraws on terminal resize via trap
|
# Redraws on terminal resize via trap
|
||||||
|
|
||||||
|
stty -echo -icanon 2>/dev/null
|
||||||
|
|
||||||
draw() {
|
draw() {
|
||||||
clear
|
clear
|
||||||
COLS=$(tput cols)
|
COLS=$(tput cols)
|
||||||
@@ -75,5 +78,5 @@ draw() {
|
|||||||
trap draw WINCH
|
trap draw WINCH
|
||||||
draw
|
draw
|
||||||
|
|
||||||
# Stay alive, redraw on resize
|
# Read-only: consume all stdin silently, redraw on resize
|
||||||
while true; do sleep 86400; done
|
while IFS= read -r -s -n 1 -t 86400 _ 2>/dev/null; do :; done
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ tmux new-window -t "$SESSION" -n "git"
|
|||||||
tmux new-window -t "$SESSION" -n "run"
|
tmux new-window -t "$SESSION" -n "run"
|
||||||
tmux new-window -t "$SESSION" -n "logs"
|
tmux new-window -t "$SESSION" -n "logs"
|
||||||
tmux new-window -t "$SESSION" -n "help" "/opt/sethmux/sethmux-help.sh"
|
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"
|
tmux select-window -t "$SESSION:1"
|
||||||
|
|
||||||
# Ensure logs dir exists
|
# Ensure logs dir exists
|
||||||
|
|||||||
Reference in New Issue
Block a user