-
Notifications
You must be signed in to change notification settings - Fork 7
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
Wrong shell used when VS code is launched via the GUI #19
Comments
I wonder if the solution is |
Thanks for the tip! This is one part of the solution. I have compared my I need to play around a bit and hopefully I can send a PR with a fix 🤞 |
Thanks. Since I use brew bash and don't have this problem, it'd probably be easier for you to attempt a PR |
So I tried the simplest change: diff --git a/src/extension.ts b/src/extension.ts
index ebb71b5..dc91247 100644
--- a/src/extension.ts
+++ b/src/extension.ts
@@ -55,6 +55,7 @@ class ExecError extends Error {
}
const promiseExec = async function (command: string, options = { cwd: getCwd() }): Promise<{ stdout: string, stderr: string }> {
+ command = `${process.env.SHELL} -ic '${command}'`
return await new Promise((resolve, reject) => {
exec(command, options, (error, stdout, stderr) => {
stdout = stdout.toString().trim() Which then fails when it tries to start the language server:
Which is weird, because |
I've read these older issues and they seem to be related:
I have a similar issue as the ones above:
If I launch VS code from a terminal the Standard extension loads fine. It doesn't load when I launch VS code from the GUI launcher (Gnome on Arch Linux). I installed VS code using this AUR package that supports appending certain command-line arguments, but to eliminate this as a source of issues, I basically launch the executable directly, with ALT+F2 (opens a run dialog) and using the full path:
/opt/visual-studio-code/bin/code
The result is this:
From the error message above, this is suspicious:
/bin/sh
is a symlink to/bin/bash
but my login shell is zsh. I also use Shopify's RubyLSP extension which seems to run bundler fine. This leads me to believe the difference between the two extensions lies in the way they launch bundler/another process.RubyLSP does detect my shell fine:
The internal VS code terminal also loads zsh properly.
Briefly looking at the code it seems /bin/sh is the default for node's child_process.exec function, however, there's definitely more to that, because running VS code from a terminal clearly doesn't use /bin/sh.
The text was updated successfully, but these errors were encountered: