set SHELL
This commit is contained in:
parent
d2a9bdabfc
commit
4b1f1fcdf9
1 changed files with 12 additions and 6 deletions
14
rc/fzf.kak
14
rc/fzf.kak
|
@ -168,12 +168,18 @@ fzf -params .. %{ evaluate-commands %sh{
|
||||||
fzfcmd="${fzf_tmp}/fzfcmd"
|
fzfcmd="${fzf_tmp}/fzfcmd"
|
||||||
result="${fzf_tmp}/result"
|
result="${fzf_tmp}/result"
|
||||||
|
|
||||||
# portable shebang
|
(
|
||||||
shell_path="$(command -v sh)"
|
shell_path="$(command -v sh)"
|
||||||
[ -n "${shell_path}" ] && printf "%s\n" "#!${shell_path}" > ${fzfcmd}
|
if [ -n "${shell_path}" ]; then
|
||||||
|
# portable shebang
|
||||||
|
printf "%s\n" "#!${shell_path}"
|
||||||
|
# set SHELL because fzf preview uses it
|
||||||
|
printf "%s\n" "SHELL=${shell_path}"
|
||||||
|
fi
|
||||||
# compose entire fzf command with all args into single file which will be executed later
|
# compose entire fzf command with all args into single file which will be executed later
|
||||||
printf "%s\n" "cd \"${PWD}\" && ${preview_position} ${items_cmd} ${fzf_impl} ${fzf_args} ${preview_cmd} ${filter} > ${result}; rm ${fzfcmd}" >> ${fzfcmd}
|
printf "%s\n" "cd \"${PWD}\" && ${preview_position} ${items_cmd} ${fzf_impl} ${fzf_args} ${preview_cmd} ${filter} > ${result}"
|
||||||
|
printf "%s\n" "rm ${fzfcmd}"
|
||||||
|
) >> ${fzfcmd}
|
||||||
chmod 755 ${fzfcmd}
|
chmod 755 ${fzfcmd}
|
||||||
|
|
||||||
if [ -n "${kak_client_env_TMUX}" ]; then
|
if [ -n "${kak_client_env_TMUX}" ]; then
|
||||||
|
|
Loading…
Reference in a new issue