1
0
Fork 0

add guard for not running outside tmux

This commit is contained in:
andreyorst 2018-09-23 00:02:02 +03:00
parent 35709d7e65
commit 8ff9ad283b

View file

@ -96,6 +96,10 @@ define-command -override -hidden fzf-cd %{
} }
define-command -override -hidden fzf -params 2 %{ exec %sh{ define-command -override -hidden fzf -params 2 %{ exec %sh{
if [ -z "${kak_client_env_TMUX}" ]; then
echo '<esc>:fail "client was not started under tmux"<ret>'
exit
fi
tmp=$(mktemp $(eval echo $kak_opt_fzf_tmp/kak-fzf.XXXXXX)) tmp=$(mktemp $(eval echo $kak_opt_fzf_tmp/kak-fzf.XXXXXX))
exec=$(mktemp $(eval echo $kak_opt_fzf_tmp/kak-exec.XXXXXX)) exec=$(mktemp $(eval echo $kak_opt_fzf_tmp/kak-exec.XXXXXX))
callback=$1; shift 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{ 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)) tmp=$(mktemp $(eval echo $kak_opt_fzf_tmp/kak-fzf.XXXXXX))
setbuf=$(mktemp $(eval echo $kak_opt_fzf_tmp/kak-setbuf.XXXXXX)) setbuf=$(mktemp $(eval echo $kak_opt_fzf_tmp/kak-setbuf.XXXXXX))
delbuf=$(mktemp $(eval echo $kak_opt_fzf_tmp/kak-delbuf.XXXXXX)) delbuf=$(mktemp $(eval echo $kak_opt_fzf_tmp/kak-delbuf.XXXXXX))