-
Notifications
You must be signed in to change notification settings - Fork 493
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't launch neovide --wsl: ERROR: Unexpected output from neovim binary #2049
Comments
I rolled back to Neovide 0.11.1 and I can launch |
Coincidentally, we debugged a very similar issue in the discord channel an hour ago.
If you change Lines 100 to 108 in 6694b0f
to let error_message_prefix = format!(
concat!(
"ERROR: Unexpected output from neovim binary:\n",
"\t{bin} -v\n",
"stdout: {stdout}\n",
"stderr: {stderr}\n",
"Check that your shell doesn't output anything extra when running:",
"\n\t"
),
bin = bin,
stdout = stdout,
stderr = String::from_utf8_lossy(&output.stderr),
); It will give you more information, and likely you will see the following
This output comes from here https://gitlab.com/procps-ng/procps/-/blob/bfb0eadc38e789737dec7f14dd7a7ac00f5f0761/src/ps/global.c#L287 Most likely there's something in your init files that calls But the real fix is to somehow figure out how to launch wsl so that it creates a properly sized terminal. We might have to create a pseudoterminal ourselves and use that for launching the wsl commands. Or alternatively force those environment variables form within neovide. This is also a very commonly reported problem in Visual Studio Code, and there they just ignore that specific error. But I don't like that solution. |
And we should also change the output to report something like that by default. |
I tried setting the COLUMNS and LINES env variables in Unfortunately, I'm having trouble compiling this repo as well so I can't make that change to see what the real error is. I can report that |
For bash you need to set them in I don't use fish shell myself, but as far as I understand On zsh the correct place is And for me, the following worked when I tested as long as it's in the correct place. export COLUMNS=80
export LINES=30 The root cause is the |
Closing as this looks addressed. Feel free to reopen if there are still issues |
I'm re-opening this. We do have a better error message now, but the root cause is still there and we have hade a few different reports. For example no-one has been able to track down exactly what triggers the Also, while manually exporting |
This issue is definitely not solved. I am getting this issue with both pwsh and cmd using neovide 0.11.2:
Output of the command:
I am using zsh 5.8.1 with Oh My Zsh.
|
@liamwh, can you run with the latest master version, it should show more info, it should show both the Lines 95 to 100 in 91344c2
|
Hello, I had the same problem under WSL2 with Ubuntu 22.04 and zsh. 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 You can also redirect the output to /dev/null Now it works it seems. |
I think we should just automatically define these two environment variables when launching Neovim, since wsl.exe does not seem to set any terminal size when running as a hidden window export COLUMNS=80
export LINES=30 |
Removing my .zprofile worked for me as well although the content was vastly different. |
I will check if we can make This at the top of export COLUMNS=80
export LINES=30 At least it did for me when I tested it earlier. But it's not a good general workaround, since we don't want to set it when running wsl in a terminal the normal way. It should only be set when Neovide launches wsl. |
The above fix,
The above error shows I'm pointing to vim via lunarvim, but I attempted this with vanilla nvim as well. You'll also note, my COLUMNS env var is being assigned correctly, but LINES is not (eg. 80x1). This holds true whether I define them in |
The bug was reported to Microsoft in November, but I don't have high hopes for a fix soon. So, I guess the best option left is to ignore the offending line, and hope for the best then. All the other stderr output should still be checked, and only lines matching Intellij made a tool to fix it, but I don't think we need to go there JetBrains/intellij-community@44be55a I'm currently on Linux, and it might take a few days until I'm back on Windows to fix this. But it should be an easy fix if someone wants to do it. |
I don't have perms to make a new branch for a PR, but here's a fix. // command.rs
fn neovim_ok (...)
...
if !(stdout.starts_with("NVIM v") && output.stderr.is_empty()) {
let win_wsl_screen_size_error =
Regex::new(r"your \d+x\d+ screen size is bogus. expect trouble").unwrap();
let stderr = String::from_utf8_lossy(&output.stderr);
if win_wsl_screen_size_error.is_match(&stderr) {
return Ok(true);
}
let error_message_prefix = format!(
concat!(
"ERROR: Unexpected output from neovim binary:\n",
"\t{bin} -v\n",
"stdout: {stdout}\n",
"stderr: {err}\n",
"Check that your shell doesn't output anything extra when running:",
"\n\t"
),
bin = bin,
stdout = stdout,
err = stderr,
);
if is_wsl {
bail!("{error_message_prefix}wsl '$SHELL' -lc '{bin} -v'");
} else {
bail!("{error_message_prefix}$SHELL -lc '{bin} -v'");
}
}
...
|
@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. |
neovide#2049 ignored error for wsl window size
Good to go! #2374
Thanks, loops through lines now rather than checking the entire stderr so we don't ignore other errors. |
* Can't launch neovide --wsl: ERROR: Unexpected output from neovim binary #2049 ignored error for wsl window size * fix: loop lines of stderr checking for regexp * updated logic to print lines at indices following a caught wsl error * revert variable name to original
This was fixed by: |
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
:I think this PR started to cause the bug for me: #1946
To Reproduce
Steps to reproduce the behavior:
"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: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 thatecho $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
orwsl 'bash' -lc '/home/linuxbrew/.linuxbrew/bin/nvim -v
I get the version printed correctly: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):
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
The text was updated successfully, but these errors were encountered: