From 777e7833825bbe9a879c1958e51badd9fef8fbab Mon Sep 17 00:00:00 2001 From: Junegunn Choi Date: Mon, 28 Sep 2026 00:49:38 +0900 Subject: [PATCH] Name the preview variable in WSLENV WSL shares only the variables listed there with a Windows vim.exe, as s:preview_cmd already does for MSWINHOME. Untested, no WSL here. --- bin/tagpreview.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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