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
xonsh always returns zero when used as the shell in vim/neovim #3402
Comments
Huh -- thanks for reporting @meatballs -- I agree that this is probably related to #3309. I'll try to take a look soon. |
If you're able to give me a clue as to where I might start, I'm happy to look into this too. |
Any program executing code in the users shell and reacting depending on the return code will always get return code 0 (in my case a This is also easy to reproduce with xonsh/0.9.11:
If you want to forward the return code, you need to use the quite verbose |
#3402 set the exit code for single commands
Fantastic! Thanks all. |
Expected Behavior
If I run a command within vim/neovim and that command fails, I should see a non-zero return code in
v:shell_error
.Current Behavior
If the shell for vim/neovim to use is xonsh,
v:shell_error
always contains zero.Steps to Reproduce
open vim/neovim
xonfig
+------------------+-----------------+
| xonsh | 0.9.8 |
| Python | 3.7.5 |
| PLY | 3.11 |
| have readline | True |
| prompt toolkit | 2.0.10 |
| shell type | prompt_toolkit2 |
| pygments | 2.3.1 |
| on posix | True |
| on linux | True |
| distro | ubuntu |
| on darwin | False |
| on windows | False |
| on cygwin | False |
| on msys2 | False |
| is superuser | False |
| default encoding | utf-8 |
| xonsh encoding | utf-8 |
| encoding errors | surrogateescape |
+------------------+-----------------+
Further Info
This works fine outside vim/neovim within a terminal running xonsh:
It even works fine within a vim/neovim terminal when xonsh is the shell:
open vim/neovim
Possibly related to #3309
Update
Confirmed as showing identical behaviour on OSX (description above is from Ubuntu).
The text was updated successfully, but these errors were encountered: