During debugging, I add echo o right after calling the system function, which then shows error
Cannot load PSReadline module. Console is running without PSReadline.
But weirdly, v:shell_error is still 0. PSReadline is a module usually installed for interactive prompt usage. Powershell.exe provides option -NonInterative for running automated scripts in non-interactive shell. Adding the -NonInteractive option fixes #1547 as the scripts run successfully without error.
[!NOTE]
This pull request only fixes firenvim installation on Windows host and
WSL2 environment. Uninstallation scripts run successfully when running firenvim on the host (%LOCALAPPDATA/firenvim/* files and corresponding registry keys are removed); run firenvim#uninstall() on WSL side only removes the binary in WSL
(stdpath('data')/firenvim in WSL or
$HOME/.local/share/firenvim/firenvim)
A separate issue #1576 tracks the uninstallation bug on WSL side
Firenvim on Windows relys on powershell scripts to run registry keys installation and uninstallation. Here are the codes:
https://github.com/glacambre/firenvim/blob/8c6c00aae7e5762cbcb4cd0df5848e959c4a9572/autoload/firenvim.vim#L890
https://github.com/glacambre/firenvim/blob/8c6c00aae7e5762cbcb4cd0df5848e959c4a9572/autoload/firenvim.vim#L958
During debugging, I add
echo o
right after calling thesystem
function, which then shows errorBut weirdly,
v:shell_error
is still0
.PSReadline
is a module usually installed for interactive prompt usage.Powershell.exe
provides option-NonInterative
for running automated scripts in non-interactive shell. Adding the-NonInteractive
option fixes #1547 as the scripts run successfully without error.