diff --git a/rc/windowing/repl/kitty.kak b/rc/windowing/repl/kitty.kak index b57d6f79..2b7bb2a0 100644 --- a/rc/windowing/repl/kitty.kak +++ b/rc/windowing/repl/kitty.kak @@ -17,7 +17,18 @@ define-command -params .. -shell-completion \ else cmd="$*" fi - kitty @ new-window --no-response --window-type $kak_opt_kitty_window_type --title kak_repl_window --cwd "$PWD" $cmd < /dev/null > /dev/null 2>&1 & + + match="" + if [ -n "$kak_client_env_KITTY_WINDOW_ID" ]; then + match="--match=id:$kak_client_env_KITTY_WINDOW_ID" + fi + + listen="" + if [ -n "$kak_client_env_KITTY_LISTEN_ON" ]; then + listen="--to=$kak_client_env_KITTY_LISTEN_ON" + fi + + kitty @ $listen launch --no-response --keep-focus --type="$kak_opt_kitty_window_type" --title=kak_repl_window --cwd="$PWD" $match $cmd } } @@ -34,7 +45,7 @@ define-command -hidden -params 0..1 \ else text="$1" fi - kitty @ send-text -m=title:kak_repl_window "$text" + kitty @ send-text --match=title:kak_repl_window "$text" } }