From 5722856e54aa81fa419694fcf326231f1617cc78 Mon Sep 17 00:00:00 2001 From: Bruno Sutic Date: Tue, 30 May 2017 02:05:23 +0200 Subject: [PATCH] Fix bug for restoring commands on tmux 2.5 --- CHANGELOG.md | 1 + scripts/process_restore_helpers.sh | 10 ++++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bccbb7d..42fb290 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,7 @@ - make archive & compress pane contents process more portable - `mutt` added to the list of automatically restored programs - added guide for migrating from tmuxinator +- fixed a bug for restoring commands on tmux 2.5 (and probably tmux 2.4) ### v2.4.0, 2015-02-23 - add "tmux-test" diff --git a/scripts/process_restore_helpers.sh b/scripts/process_restore_helpers.sh index 98dda6c..cc796d2 100644 --- a/scripts/process_restore_helpers.sh +++ b/scripts/process_restore_helpers.sh @@ -13,6 +13,7 @@ restore_pane_process() { local window_number="$3" local pane_index="$4" local dir="$5" + local command if _process_should_be_restored "$pane_full_command" "$session_name" "$window_number" "$pane_index"; then tmux switch-client -t "${session_name}:${window_number}" tmux select-pane -t "$pane_index" @@ -25,15 +26,16 @@ restore_pane_process() { local strategy_file="$(_get_strategy_file "$inline_strategy")" local inline_strategy="$($strategy_file "$pane_full_command" "$dir")" fi - tmux send-keys "$inline_strategy" "C-m" + command="$inline_strategy" elif _strategy_exists "$pane_full_command"; then local strategy_file="$(_get_strategy_file "$pane_full_command")" local strategy_command="$($strategy_file "$pane_full_command" "$dir")" - tmux send-keys "$strategy_command" "C-m" + command="$strategy_command" else - # just invoke the command - tmux send-keys "$pane_full_command" "C-m" + # just invoke the raw command + command="$pane_full_command" fi + tmux send-keys -t "${session_name}:${window_number}" "$command" "C-m" fi }