From 79db90349d89e432a100776586a1d73ee1ef4555 Mon Sep 17 00:00:00 2001 From: Johannes Altmanninger Date: Sun, 30 Oct 2022 18:52:02 +0100 Subject: [PATCH] rc repl tmux: show error when the repl pane is gone tmux-send-text would silently fail when the repl is no more. Let's instead print an error, pointing the user to the *debug* buffer which has tmux' stderr. --- rc/windowing/repl/tmux.kak | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/rc/windowing/repl/tmux.kak b/rc/windowing/repl/tmux.kak index 3238fbe7..a0450567 100644 --- a/rc/windowing/repl/tmux.kak +++ b/rc/windowing/repl/tmux.kak @@ -71,13 +71,14 @@ define-command -hidden tmux-send-text -params 0..1 -docstring %{ tmux-send-text [text]: Send text to the REPL pane. If no text is passed, then the selection is used } %{ - nop %sh{ + evaluate-commands %sh{ if [ $# -eq 0 ]; then tmux set-buffer -b kak_selection -- "${kak_selection}" else tmux set-buffer -b kak_selection -- "$1" fi - tmux paste-buffer -b kak_selection -t "$kak_opt_tmux_repl_id" + tmux paste-buffer -b kak_selection -t "$kak_opt_tmux_repl_id" || + echo 'fail tmux-send-text: failed to send text, see *debug* buffer for details' } }