From 96447a30e94fc3db9f81999b9cb5e5991e6865e7 Mon Sep 17 00:00:00 2001 From: daryl Date: Mon, 11 Jul 2022 14:03:17 +0930 Subject: [PATCH] Update 'bash/tmux_launcher.bash' --- bash/tmux_launcher.bash | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/bash/tmux_launcher.bash b/bash/tmux_launcher.bash index 30459a2..57f128c 100644 --- a/bash/tmux_launcher.bash +++ b/bash/tmux_launcher.bash @@ -11,8 +11,19 @@ tmux attach -t sessionname # jump into the acti tmux send-keys -t sessionname:0.0 'q' 'C-m' # tell 'top' in top pane to quit (C-m probably not needed here...) tmux kill-session -t sessionname # close tmux session + # NOTE: need the following at the end of 'script.bs' to make it drop out, first two lines are optional but a good way to hold # the session open until user is ready to close it, last line is the kick back to this higher level tmux wrapper. +# # echo "Press any key to close the window." # read -s -n1 # tmux detach +# +# If you can also call script.bs NOT from the tmux wrapper, then only do the above if you're actually insidie a tmux. +# This works because tmux handily sets the TMUX variable so you can trivially check. +# +# if [ "$TMUX" ]; then +# echo "Press any key to close the window." +# read -s -n1 +# tmux detach +# fi \ No newline at end of file