neovide: Can't launch neovide --wsl: ERROR: Unexpected output from neovim binary

Describe the bug I have neovide installed on windows and neovim installed inside WSL (with brew install neovim).

Inside a WSL shell I can successfully launch nvim and this is the output of nvim -v:

nvim -v
NVIM v0.9.2
Build type: Release
LuaJIT 2.1.0-beta3

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "
/home/linuxbrew/.linuxbrew/Cellar/neovim/0.9.2/share/nvim"

Run :checkhealth for more info

I think this PR started to cause the bug for me: https://github.com/neovide/neovide/pull/1946

To Reproduce Steps to reproduce the behavior:

  1. Launch neovide with --wsl option: "C:\Program Files\Neovide\neovide.exe" --wsl
  2. Does not launch and displays error:
ERROR: Unexpected output from neovim binary:
/home/linuxbrew/.linuxbrew/bin/nvim -v
Check that your shell doesn't output anything extra when running:
wsl '$SHELL' -lc '/home/linuxbrew/.linuxbrew/bin/nvim -v'
"C:\Program Files\Neovide\neovide.exe" --wsl

I ran wsl '$SHELL' -lc '/home/linuxbrew/.linuxbrew/bin/nvim -v' in a cmd.exe shell and I get the error:

fish: Unknown command: '$SHELL'
fish:
'$SHELL' -lc '/home/linuxbrew/.linuxbrew/bin/nvim -v'
^

I think this has something to do with having my WSL shell set to the fish shell? I tried setting the $SHELL environment inside WSL to /usr/bin/fish so that echo $SHELL returns /usr/bin/fish, but I still get the same error.

Also if I run wsl 'fish' -lc '/home/linuxbrew/.linuxbrew/bin/nvim -v or wsl 'bash' -lc '/home/linuxbrew/.linuxbrew/bin/nvim -v I get the version printed correctly:

NVIM v0.9.2
Build type: Release
LuaJIT 2.1.0-beta3                                                                                                                                                                                                                                     system vimrc file: "$VIM/sysinit.vim"
fall-back for $VIM: "
/home/linuxbrew/.linuxbrew/Cellar/neovim/0.9.2/share/nvim"

Run :checkhealth for more info

So it is not understanding the $SHELL variable despite having set that in both .bashrc and .config/fish/config.fish.

Expected behavior I can launch neovide in wsl.

Desktop (please complete the following information):

  • OS: Windows 10 Pro (10.0.19044 Built 19044)
  • Neovide Version 0.11.2
  • Neovim Version 0.9.2

Please run neovide --log and paste the contents of the .log file created in the current directory here:

I can’t because I can’t launch neovide

About this issue

  • Original URL
  • State: closed
  • Created 9 months ago
  • Reactions: 1
  • Comments: 21 (14 by maintainers)

Commits related to this issue

Most upvoted comments

@DZappala, thank you.

You should have permissions to make a PR, everyone does. But you need to do it from your own fork.

But one thing, I think you need to do the check for all lines separately, otherwise there might be other standard error output.

Hello,

I had the same problem under WSL2 with Ubuntu 22.04 and zsh. The problem was due to “ssh-agent” which was launched automatically each time the shell was launched.

My .zprofile :

$ cat ~/.zprofile
if [ -z "$SSH_AUTH_SOCK" ]; then
   # Check for a currently running instance of the agent
   RUNNING_AGENT="`ps -ax | grep 'ssh-agent -s' | grep -v grep | wc -l | tr -d '[:space:]'`"
   if [ "$RUNNING_AGENT" = "0" ]; then
        # Launch a new instance of the agent
        ssh-agent -s &> $HOME/.ssh/ssh-agent
   fi
   eval `cat $HOME/.ssh/ssh-agent`
fi

To solve this, I had to delete ~/.zprofile Check your bashrc, zshrc, or others for a line that launches ssh-agent

You can also redirect the output to /dev/null

Now it works it seems.

i have the same problem image

I just tried running the latest main version and got this error: neovide

So the stderr bit there must be the problem? I don’t get that stderr output if I just run nvim -v inside a wsl shell. I also don’t get that output if I run wsl '$SHELL' -lc '/home/linuxbrew/.linuxbrew/bin/nvim -v' from powershell.