From 763bb5aed14d29d46e646985e2dfb20afd988670 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Thu, 5 May 2016 13:32:16 +0100 Subject: [PATCH] Use the current client tmux session when splitting a new client --- rc/core/tmux.kak | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/rc/core/tmux.kak b/rc/core/tmux.kak index 3b469ac7..70c5115e 100644 --- a/rc/core/tmux.kak +++ b/rc/core/tmux.kak @@ -16,14 +16,15 @@ hook global KakBegin .* %{ ## Temporarily override the default client creation command def -hidden -params 1.. tmux-new-impl %{ %sh{ - if [ -z "$TMUX" ]; then + tmux=${kak_client_env_TMUX:-$TMUX} + if [ -z "$tmux" ]; then echo "echo -color Error 'This command is only available in a tmux session'" exit fi tmux_args="$1" shift if [ $# -ne 0 ]; then kakoune_params="-e '$@'"; fi - tmux $tmux_args "kak -c ${kak_session} ${kakoune_params}" < /dev/null > /dev/null 2>&1 & + TMUX=$tmux tmux $tmux_args "kak -c ${kak_session} ${kakoune_params}" < /dev/null > /dev/null 2>&1 & } }