From 7091597c138e9327088f1df7e87733cc22e352a8 Mon Sep 17 00:00:00 2001 From: "chawley (overlook)" Date: Tue, 21 Jul 2026 15:36:22 -0400 Subject: [PATCH] Updated to allow multiple commands per window --- tmi-template.sh | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/tmi-template.sh b/tmi-template.sh index 993b5a4..5e39f09 100644 --- a/tmi-template.sh +++ b/tmi-template.sh @@ -12,7 +12,7 @@ set -euo pipefail -readonly TMUX_CONF="${HOME}/.tmux.conf" +readonly TMUX_CONF="${HOME}/.tmux.conf.aamon" # Ensure we are not nesting tmux sessions if [[ -n "${TMUX:-}" ]]; then @@ -21,16 +21,17 @@ if [[ -n "${TMUX:-}" ]]; then fi # Define session layouts as data maps: "window_index:window_name:command" -# Index 1 is reserved for the initial session window (renamed inline). +# Field separator is ';' to safely allow command chains (&&, ;, etc.) inside field 3. +# Index 1 is reserved for the initial session window. declare -A SESSIONS SESSIONS[mine]=" -1:local(phansible@aamon): -2:phansible@overlook:exec ssh phansible@overlook.tailc38dc9.ts.net -3:weechat:exec ssh overlook-ts && docker start weechat && docker attach weechat -4:chawley@overlook:exec ssh overlook-ts -5:chawley@shawshank:exec ssh shawshank-ts -6:root@derry:exec ssh derry-ts +1;local(phansible@aamon); +2;phansible@overlook;exec ssh phansible@overlook.tailc38dc9.ts.net +3;weechat;ssh -t overlook-ts 'docker start -ai weechat' +4;chawley@overlook;exec ssh overlook-ts +5;chawley@shawshank;exec ssh shawshank-ts +6;root@derry;exec ssh derry-ts " list_active_sessions() { @@ -75,9 +76,9 @@ fi echo "Building session: ${session}" -# Process layout line by line +# Process layout line by line using semicolon delimiter first_window=true -while IFS=':' read -r idx name cmd; do +while IFS=';' read -r idx name cmd; do [[ -z "${idx}" ]] && continue if [[ "${first_window}" == true ]]; then