From 37dcba9089424f4409146a5b98961e9bfae95443 Mon Sep 17 00:00:00 2001 From: Johannes Altmanninger Date: Sun, 30 Oct 2022 19:08:50 +0100 Subject: [PATCH] rc repl tmux: do not record repl session/window since pane might move A pane's ID is immutable for the lifetime of the tmux server. Same with window/session IDs. When creating a new tmux repl, we record all three IDs to later use them to send text to the repl. The window/session IDs can be invalidating when a pane is moved to a different window/session (via "tmux move-pane", "tmux move-window" etc). This will cause repl-send-text to fail. Fix this by dropping the redundant and potentially incorrect window/session IDs. The immutable pane ID is enough. --- rc/windowing/repl/tmux.kak | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rc/windowing/repl/tmux.kak b/rc/windowing/repl/tmux.kak index 5c08b943..885c75cf 100644 --- a/rc/windowing/repl/tmux.kak +++ b/rc/windowing/repl/tmux.kak @@ -19,7 +19,7 @@ define-command -hidden -params 1.. tmux-repl-impl %{ tmux_args="$1" shift tmux $tmux_args "$@" - printf "set-option current tmux_repl_id '%s'" $(tmux display-message -p '#{session_id}:#{window_id}.#{pane_id}') + printf "set-option current tmux_repl_id '%s'" $(tmux display-message -p '#{pane_id}') } } @@ -58,7 +58,7 @@ define-command -params 0..1 tmux-repl-set-pane -docstring %{ fi curr_win="$(tmux display-message -p '#{window_id}')" if tmux list-panes -t "$curr_win" -F \#D | grep -Fxq "%"$tgt_pane; then - printf "set-option current tmux_repl_id '%s'" $(tmux display-message -p '#{session_id}:#{window_id}.')%$tgt_pane + printf "set-option current tmux_repl_id '%s'" %$tgt_pane else echo 'fail The correct pane is not there. Activate using tmux-terminal-* or some other way' fi