diff --git a/rc/windowing/repl/x11.kak b/rc/windowing/repl/x11.kak index a9256611..d7e6ed21 100644 --- a/rc/windowing/repl/x11.kak +++ b/rc/windowing/repl/x11.kak @@ -13,8 +13,9 @@ define-command -docstring %{ -params .. \ -shell-completion \ x11-repl %{ x11-terminal sh -c %{ + winid="${WINDOWID:-$(xdotool search --pid ${PPID} | tail -1)}" printf "evaluate-commands -try-client $1 \ - 'set-option current x11_repl_id ${WINDOWID}'" | kak -p "$2" + 'set-option current x11_repl_id ${winid}'" | kak -p "$2" shift 2; [ "$1" ] && "$@" || "$SHELL" } -- %val{client} %val{session} %arg{@}