From c2d3493da3d37a9ec1fe4166d7573b3f18392454 Mon Sep 17 00:00:00 2001 From: Kovacsics Robert Date: Tue, 16 Sep 2025 01:47:28 +0100 Subject: [PATCH 1/4] Robert Kovacsics Copyright Waiver I dedicate any and all copyright interest in this software to the public domain. I make this dedication for the benefit of the public at large and to the detriment of my heirs and successors. I intend this dedication to be an overt act of relinquishment in perpetuity of all present and future rights to this software under copyright law. From 223933811751abae906baf81e44006106cb879fb Mon Sep 17 00:00:00 2001 From: Kovacsics Robert Date: Tue, 16 Sep 2025 01:40:54 +0100 Subject: [PATCH 2/4] rc repl tmux: Fix trailing space --- rc/windowing/repl/tmux.kak | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rc/windowing/repl/tmux.kak b/rc/windowing/repl/tmux.kak index 5b7763324e..8d7810d667 100644 --- a/rc/windowing/repl/tmux.kak +++ b/rc/windowing/repl/tmux.kak @@ -61,7 +61,7 @@ define-command -params 0..1 tmux-repl-set-pane -docstring %{ else tgt_pane="$1" fi - curr_win="$(tmux display-message -t ${kak_client_env_TMUX_PANE} -p '#{window_id}')" + curr_win="$(tmux display-message -t ${kak_client_env_TMUX_PANE} -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'" %$tgt_pane else From 4cb88e94cf47f200e4ec220efca115a4618612e1 Mon Sep 17 00:00:00 2001 From: Kovacsics Robert Date: Mon, 15 Sep 2025 22:34:37 +0100 Subject: [PATCH 3/4] rc repl tmux: Use bracketed paste, add option to turn off This is required for e.g Python 3.13's _pyrepl pasting to work properly, otherwise it indents the next line which doesn't work with Python. --- rc/windowing/repl/tmux.kak | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/rc/windowing/repl/tmux.kak b/rc/windowing/repl/tmux.kak index 8d7810d667..1cf7207988 100644 --- a/rc/windowing/repl/tmux.kak +++ b/rc/windowing/repl/tmux.kak @@ -9,6 +9,7 @@ hook global ModuleLoaded tmux %{ provide-module tmux-repl %{ declare-option -docstring "tmux pane id in which the REPL is running" str tmux_repl_id +declare-option -docstring "whether to use bracketed paste" bool repl_bracketed_paste true define-command -hidden -params 1.. tmux-repl-impl %{ evaluate-commands %sh{ @@ -80,7 +81,7 @@ define-command -hidden tmux-send-text -params 0..1 -docstring %{ else tmux set-buffer -b kak_selection -- "$1" fi - tmux paste-buffer -b kak_selection -t "$kak_opt_tmux_repl_id" || + tmux paste-buffer ${kak_opt_repl_bracketed_paste:+-p} -b kak_selection -t "$kak_opt_tmux_repl_id" || echo 'fail tmux-send-text: failed to send text, see *debug* buffer for details' } } From 40f7ffb2100c7a28e241ad8220484d86f9298a62 Mon Sep 17 00:00:00 2001 From: Kovacsics Robert Date: Mon, 15 Sep 2025 22:59:44 +0100 Subject: [PATCH 4/4] rc repl tmux: Send all selections not just main This is most useful for e.g. Python code, where you might have something like ```python def function_under_test(): if foo: print(bar) ``` so you do something like selecting the `if` and `print` lines `/if]fx` (lsp plugin select to end of function), and then convert it to block selection using `S^ {,4}` (for 4 space indent) then it will send the dedented lines to the repl. Not adding an option for this as the old way of only sending the main selection can be done using `,: tmux-send-repl`. --- rc/windowing/repl/tmux.kak | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rc/windowing/repl/tmux.kak b/rc/windowing/repl/tmux.kak index 1cf7207988..5051eaa422 100644 --- a/rc/windowing/repl/tmux.kak +++ b/rc/windowing/repl/tmux.kak @@ -77,7 +77,7 @@ define-command -hidden tmux-send-text -params 0..1 -docstring %{ } %{ evaluate-commands %sh{ if [ $# -eq 0 ]; then - tmux set-buffer -b kak_selection -- "${kak_selection}" + tmux set-buffer -b kak_selection -- "${kak_selections}" else tmux set-buffer -b kak_selection -- "$1" fi