diff --git a/rc/base/screen.kak b/rc/base/screen.kak index 157d38d09..f474fb8fa 100644 --- a/rc/base/screen.kak +++ b/rc/base/screen.kak @@ -1,9 +1,9 @@ # http://gnu.org/software/screen/ # ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾ -hook global KakBegin .* %{ +hook -group GNUscreen global KakBegin .* %{ %sh{ - [ -z "${kak_client_env_STY}" ] && exit + [ -z "${STY}" ] && exit echo " alias global focus screen-focus alias global new screen-new-vertical @@ -15,14 +15,24 @@ hook global KakBegin .* %{ define-command screen-new-vertical -params .. -command-completion -docstring "Create a new vertical region" %{ %sh{ tty="$(ps -o tty ${kak_client_pid} | tail -n 1)" - screen -X eval 'split -h' 'focus down' "screen kak -c \"${kak_session}\" -e \"$*\"" < "/dev/$tty" + screen -X eval \ + 'split -h' \ + 'focus down' \ + "screen sh -c 'kak -c \"${kak_session}\" -e \"$*\" ; + screen -X remove'" \ + < "/dev/$tty" } } define-command screen-new-horizontal -params .. -command-completion -docstring "Create a new horizontal region" %{ %sh{ tty="$(ps -o tty ${kak_client_pid} | tail -n 1)" - screen -X eval 'split -v' 'focus right' "screen kak -c \"${kak_session}\" -e \"$*\"" < "/dev/$tty" + screen -X eval \ + 'split -v' \ + 'focus right' \ + "screen sh -c 'kak -c \"${kak_session}\" -e \"$*\" ; + screen -X remove'" \ + < "/dev/$tty" } } @@ -39,11 +49,10 @@ If no client is passed then the current one is used} \ screen-focus %{ %sh{ if [ $# -eq 1 ]; then printf %s\\n " - evaluate-commands -client '$1' %{ %sh{ - screen -X focus - }}" + evaluate-commands -client '$1' focus + " elif [ -n "${kak_client_env_STY}" ]; then tty="$(ps -o tty ${kak_client_pid} | tail -n 1)" - screen -X select "$kak_client_env_WINDOW" < "/dev/$tty" + screen -X select "${kak_client_env_WINDOW}" < "/dev/$tty" fi } }