pull/295/merge
Gullumluvl 2021-12-30 13:27:56 -10:00 committed by GitHub
commit 725e93c32a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 4 deletions

View File

@ -310,7 +310,7 @@ restore_shell_history() {
if [ "$pane_command" = "bash" ]; then
local read_command="history -r '$history_file'"
tmux send-keys -t "$pane_id" "$read_command" C-m
tmux send-keys -t "$pane_id" M-z "$read_command" C-m M-Z
elif [ "$pane_command" = "zsh" ]; then
local accept_line="$(expr "$(zsh -i -c bindkey | grep -m1 '\saccept-line$')" : '^"\(.*\)".*')"
local read_command="fc -R '$history_file'; clear"

View File

@ -176,9 +176,8 @@ save_shell_history() {
local read_command=" $history_r '$(resurrect_history_file "$pane_id" "$pane_command")'"
# C-e C-u is a Bash shortcut sequence to clear whole line. It is necessary to
# delete any pending input so it does not interfere with our history command.
tmux send-keys -t "$pane_id" "$end_of_line" "$backward_kill_line" "$write_command" "$accept_line"
# Immediately restore after saving
tmux send-keys -t "$pane_id" "$end_of_line" "$backward_kill_line" "$read_command" "$accept_line"
# and immediately restore after saving
tmux send-keys -t "$pane_id" "$end_of_line" "$backward_kill_line" M-z "$write_command;$read_command" "$accept_line" M-Z
fi
}