1
0
Fork 0

Merge pull request #50 from andreyorst/fix-fish

Fix fish
This commit is contained in:
Andrey Orst 2019-03-31 13:17:12 +03:00 committed by GitHub
commit c58323ddb3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -168,11 +168,18 @@ fzf -params .. %{ evaluate-commands %sh{
fzfcmd="${fzf_tmp}/fzfcmd" fzfcmd="${fzf_tmp}/fzfcmd"
result="${fzf_tmp}/result" result="${fzf_tmp}/result"
shell_executable="$(command -v sh)" (
shell_path="$(command -v sh)"
# compose entire fzf command with all args into single file which will be executed later if [ -n "${shell_path}" ]; then
printf "%s\n" "cd \"${PWD}\" && ${preview_position} ${items_cmd} SHELL=${shell_executable} ${fzf_impl} ${fzf_args} ${preview_cmd} ${filter} > ${result}; rm ${fzfcmd}" > ${fzfcmd} # 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
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