-
-
Notifications
You must be signed in to change notification settings - Fork 300
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
vscode-neovim doesn't work with Elvish as default shell #1804
Comments
Elvish is not responsible for interpreting the shebang line, so there's something else going on. How did you set Elvish to be your default shell? |
Also - what's the name of your script and can you elaborate why it's necessary for your setup? I took a look at the vscode-neovim extension and it doesn't mention that you need to create a custom script to use it, so I suppose it's some custom setup you're using? |
I set default shell by issue this command:
I did re-login/out before doing any test.
it's named
you can check it here: https://github.com/milanglacier/nvim#seamless-integration-with-vscode this script due to users want to use a separate neovim config for vscode-neovim instance and the default neovim that load so i have another folder |
OK thanks, I understand what you are trying to do now. There seems to be quite a few moving parts in this setup you are using, and any component could be passing code through the login shell (rather than the correct thing, using an API that maps to a direct exec call without going through the shell), so making sure that the |
Some things to check:
|
Hmm looking at the error code you're getting (ENOENT) - did you set |
Note that Zsh and Bash are both POSIX compatible shells (more or less). I would expect that you would experience similar problems if you used another non-POSIX shell such as Fish or Xonsh. This type of situation is why the best practice is to leave your "login" shell something like Zsh or Bash and configure your terminal emulator to spawn Elvish instead of your login shell; see https://elv.sh/get/default-shell.html. As @hanche suggested in the IM chat it a useful experiment is to try invoking the relevant programs with something like My primary OS is also macOS and it is very frustrating that it doesn't support a usable
Where the original program is renamed to /path/to/real-program and the script is installed as the original /path/to/program whose invocation we want to track. |
yes, default shell is
this set to |
this can be more useful than force macos user default shell but when i try to set vscode's terminal default shell, i can't: |
ok i got that, it's smth like |
@tmpm697 Glad to know you worked around the issue. I've updated https://elv.sh/get/default-shell.html to include instruction for using Elvish from VS Code's terminal and documented vscode-neovim's incompatibility issue. |
thanks, if having elvish shell this way, is that it will first spawn if true, then elvish will get all exported env vars from zsh? |
Yes, because that is how env vars work; at least on Unix like operating systems such as macOS and Linux. Env vars are private to each process. When a process, such as |
I don't think any terminal has the literal behavior you're describing. Normally the login shell won't be involved. AFAICT some Linux desktop environments involve the login shell at some point during the login process, so you can end up getting environment variables from the profile file of the login shell, but you're using macOS so that's not relevant to you.
I think you're answering @tmpm697's second question assuming that the answer to the first question is yes, which I believe is not the case. |
vscode's settngs:
no idea but this is number of vars in elvish and zsh:
compare zsh's so it seems that vscode on macos spawn zsh first and then I don't |
What happened, and what did you expect to happen?
I have this script in
PATH
variable and used for vscode to spawn neovim instance to use withvscode-neovim
extension:but it fail to start (my current default shell is
elvish
)before switched to elvish, i use zsh and the above script just work out-of-box
Output of "elvish -version"
0.20.1
Code of Conduct
The text was updated successfully, but these errors were encountered: