diff --git a/bin/tagpreview.sh b/bin/tagpreview.sh index 0be6687..07ca0da 100755 --- a/bin/tagpreview.sh +++ b/bin/tagpreview.sh @@ -35,7 +35,10 @@ fi # it cannot run a shell command or touch a file. ':sandbox' on its own only # covers the command up to the first '|', hence 'sandbox execute' on a value # passed through the environment, which keeps the whole address inside -CENTER="$(FZFVIM_EXCMD="${EXCMD}" "${VIMNAME}" -R -i NONE -u NONE -e -m -s "${FILE}" \ +export FZFVIM_EXCMD="${EXCMD}" +# WSL shares only the variables named in WSLENV with a Windows vim.exe +export WSLENV="FZFVIM_EXCMD/w${WSLENV:+:${WSLENV}}" +CENTER="$("${VIMNAME}" -R -i NONE -u NONE -e -m -s "${FILE}" \ -c "set nomagic" \ -c 'silent sandbox execute $FZFVIM_EXCMD' \ -c 'let l=line(".") | new | put =l | print | qa!')" || exit