Usability enhancements for Tmux

* Press 'q' to quit Tmux
* In case of errors, Tmux will wait for a keypress before closing a pane
This commit is contained in:
Zahary Karadjov 2020-06-17 15:55:55 +03:00 committed by zah
parent 01ea66f24e
commit ffb613d3c6
3 changed files with 5 additions and 5 deletions

View File

@ -24,6 +24,8 @@ if [[ "$USE_TMUX" != "no" ]]; then
$TMUX_CMD new-session -s "${TMUX_SESSION_NAME}" -d
$TMUX_CMD bind-key -n q kill-session
# maybe these should be moved to a user config file
$TMUX_CMD set-option -t "${TMUX_SESSION_NAME}" history-limit 999999
$TMUX_CMD set-option -t "${TMUX_SESSION_NAME}" remain-on-exit on
@ -33,9 +35,7 @@ if [[ "$USE_TMUX" != "no" ]]; then
$TMUX_CMD new-window -d -t "${TMUX_SESSION_NAME}" -n "sim"
$TMUX_CMD kill-pane -t "${TMUX_SESSION_NAME}:0"
trap 'tmux kill-session -t "${TMUX_SESSION_NAME}"' SIGINT EXIT
$TMUX_CMD new-window -t "${TMUX_SESSION_NAME}" -n "start-script" "$PWD/start.sh"
$TMUX_CMD new-window -t "${TMUX_SESSION_NAME}" -n "start-script" "if ! $PWD/start.sh; then; read; tmux kill-session; fi"
$TMUX_CMD select-window -t "${TMUX_SESSION_NAME}:start-script"
$TMUX_CMD attach-session -t "${TMUX_SESSION_NAME}"

View File

@ -140,7 +140,7 @@ function run_cmd {
if [[ "$USE_TMUX" == "yes" ]]; then
echo "Starting node $i..."
$TMUX_CMD select-window -t "${TMUX_SESSION_NAME}:sim"
$TMUX_CMD split-window -t "${TMUX_SESSION_NAME}" "$CMD"
$TMUX_CMD split-window -t "${TMUX_SESSION_NAME}" "if ! $CMD; then; read; fi"
$TMUX_CMD select-layout -t "${TMUX_SESSION_NAME}:sim" tiled
elif [[ "$USE_MULTITAIL" != "no" ]]; then
if [[ "$i" == "$MASTER_NODE" ]]; then

@ -1 +1 @@
Subproject commit 35eeb035b2b8e1dc770efdf76a0e4c5f369d8a0a
Subproject commit dc2c199d41dc90de75043d1ee4efe5e0323932bf