From 8ff9ad283bbd1514ae1360c52dda46016655ec5f Mon Sep 17 00:00:00 2001 From: andreyorst Date: Sun, 23 Sep 2018 00:02:02 +0300 Subject: [PATCH] add guard for not running outside tmux --- rc/fzf.kak | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/rc/fzf.kak b/rc/fzf.kak index d3eac97..1db7ada 100644 --- a/rc/fzf.kak +++ b/rc/fzf.kak @@ -96,6 +96,10 @@ define-command -override -hidden fzf-cd %{ } define-command -override -hidden fzf -params 2 %{ exec %sh{ + if [ -z "${kak_client_env_TMUX}" ]; then + echo ':fail "client was not started under tmux"' + exit + fi tmp=$(mktemp $(eval echo $kak_opt_fzf_tmp/kak-fzf.XXXXXX)) exec=$(mktemp $(eval echo $kak_opt_fzf_tmp/kak-exec.XXXXXX)) callback=$1; shift @@ -119,6 +123,10 @@ define-command -override -hidden fzf -params 2 %{ exec %sh{ }} define-command -override -hidden fzf-buffer %{ evaluate-commands %sh{ + if [ -z "${kak_client_env_TMUX}" ]; then + echo 'fail "client was not started under tmux"' + exit + fi tmp=$(mktemp $(eval echo $kak_opt_fzf_tmp/kak-fzf.XXXXXX)) setbuf=$(mktemp $(eval echo $kak_opt_fzf_tmp/kak-setbuf.XXXXXX)) delbuf=$(mktemp $(eval echo $kak_opt_fzf_tmp/kak-delbuf.XXXXXX))