From 0938a75c0508f52723b4e1e817c09422022d645d Mon Sep 17 00:00:00 2001 From: maybeetree Date: Sun, 7 Aug 2022 22:14:08 +0200 Subject: [PATCH] save-current: support session with space in name --- scripts/save.sh | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/scripts/save.sh b/scripts/save.sh index 8728d19..87b0b5d 100755 --- a/scripts/save.sh +++ b/scripts/save.sh @@ -91,24 +91,16 @@ state_format() { echo "$format" } -session_selector_windows() { - [ -z "$TARGET_SESSION" ] && - echo "-a" || - echo "-t $TARGET_SESSION" -} - -session_selector_panes() { - [ -z "$TARGET_SESSION" ] && - echo "-a" || - echo "-s -t $TARGET_SESSION" -} - dump_panes_raw() { - tmux list-panes $(session_selector_panes) -F "$(pane_format)" + [ -z "$TARGET_SESSION" ] && + tmux list-panes -a -F "$(pane_format)" || + tmux list-panes -s -t "$TARGET_SESSION" -F "$(pane_format)" } dump_windows_raw(){ - tmux list-windows $(session_selector_windows) -F "$(window_format)" + [ -z "$TARGET_SESSION" ] && + tmux list-windows -a -F "$(window_format)" || + tmux list-windows -t "$TARGET_SESSION" -F "$(window_format)" } toggle_window_zoom() {