Fix bug for restoring commands on tmux 2.5

This commit is contained in:
Bruno Sutic 2017-05-30 02:05:23 +02:00
parent b8cc90a7f4
commit 5722856e54
No known key found for this signature in database
GPG Key ID: CAFA7B1B2914ED81
2 changed files with 7 additions and 4 deletions

View File

@ -17,6 +17,7 @@
- make archive & compress pane contents process more portable - make archive & compress pane contents process more portable
- `mutt` added to the list of automatically restored programs - `mutt` added to the list of automatically restored programs
- added guide for migrating from tmuxinator - 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 ### v2.4.0, 2015-02-23
- add "tmux-test" - add "tmux-test"

View File

@ -13,6 +13,7 @@ restore_pane_process() {
local window_number="$3" local window_number="$3"
local pane_index="$4" local pane_index="$4"
local dir="$5" local dir="$5"
local command
if _process_should_be_restored "$pane_full_command" "$session_name" "$window_number" "$pane_index"; then if _process_should_be_restored "$pane_full_command" "$session_name" "$window_number" "$pane_index"; then
tmux switch-client -t "${session_name}:${window_number}" tmux switch-client -t "${session_name}:${window_number}"
tmux select-pane -t "$pane_index" tmux select-pane -t "$pane_index"
@ -25,15 +26,16 @@ restore_pane_process() {
local strategy_file="$(_get_strategy_file "$inline_strategy")" local strategy_file="$(_get_strategy_file "$inline_strategy")"
local inline_strategy="$($strategy_file "$pane_full_command" "$dir")" local inline_strategy="$($strategy_file "$pane_full_command" "$dir")"
fi fi
tmux send-keys "$inline_strategy" "C-m" command="$inline_strategy"
elif _strategy_exists "$pane_full_command"; then elif _strategy_exists "$pane_full_command"; then
local strategy_file="$(_get_strategy_file "$pane_full_command")" local strategy_file="$(_get_strategy_file "$pane_full_command")"
local strategy_command="$($strategy_file "$pane_full_command" "$dir")" local strategy_command="$($strategy_file "$pane_full_command" "$dir")"
tmux send-keys "$strategy_command" "C-m" command="$strategy_command"
else else
# just invoke the command # just invoke the raw command
tmux send-keys "$pane_full_command" "C-m" command="$pane_full_command"
fi fi
tmux send-keys -t "${session_name}:${window_number}" "$command" "C-m"
fi fi
} }