From 52222a52e4acab1a08f2cba5342d66c1b04ac954 Mon Sep 17 00:00:00 2001 From: Hideaki Kawai Date: Fri, 22 Jan 2021 09:19:35 +0900 Subject: [PATCH] Support KITTY_LISTEN_ON on kitty-terminal-tab and kitty-focus --- rc/windowing/kitty.kak | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/rc/windowing/kitty.kak b/rc/windowing/kitty.kak index 5b243c2d..2cbbd74a 100644 --- a/rc/windowing/kitty.kak +++ b/rc/windowing/kitty.kak @@ -28,7 +28,11 @@ kitty-terminal-tab []: create a new terminal as kitty tab The program passed as argument will be executed in the new terminal' \ %{ nop %sh{ - kitty @ new-window --no-response --new-tab --cwd "$PWD" "$@" + if [ -z "$kak_client_env_KITTY_LISTEN_ON" ]; then + kitty @ new-window --no-response --new-tab --cwd "$PWD" "$@" + else + kitty @ --to "$kak_client_env_KITTY_LISTEN_ON" new-window --no-response --new-tab --cwd "$PWD" "$@" + fi } } @@ -40,8 +44,13 @@ If no client is passed then the current one is used' \ if [ $# -eq 1 ]; then printf "evaluate-commands -client '%s' focus" "$1" else - kitty @ focus-tab --no-response -m=id:$kak_client_env_KITTY_WINDOW_ID - kitty @ focus-window --no-response -m=id:$kak_client_env_KITTY_WINDOW_ID + if [ -z "$kak_client_env_KITTY_LISTEN_ON" ]; then + kitty @ focus-tab --no-response -m=id:$kak_client_env_KITTY_WINDOW_ID + kitty @ focus-window --no-response -m=id:$kak_client_env_KITTY_WINDOW_ID + else + kitty @ --to "$kak_client_env_KITTY_LISTEN_ON" focus-tab --no-response -m=id:$kak_client_env_KITTY_WINDOW_ID + kitty @ --to "$kak_client_env_KITTY_LISTEN_ON" focus-window --no-response -m=id:$kak_client_env_KITTY_WINDOW_ID + fi fi } }