From 845a1304251682c8a8afa5cf643c5e21daa406db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafael=20Mendon=C3=A7a=20Fran=C3=A7a?= Date: Thu, 22 Jan 2026 13:40:09 -0500 Subject: [PATCH] Use configured shell from vscode.env.shell instead of process.env.SHELL This will make sure the detection system will use the configured shell in VS Code, and works without having on the SHELL environment variable set. --- vscode/src/ruby.ts | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/vscode/src/ruby.ts b/vscode/src/ruby.ts index 940285825..d0a6d8371 100644 --- a/vscode/src/ruby.ts +++ b/vscode/src/ruby.ts @@ -65,7 +65,6 @@ export class Ruby implements RubyInterface { .getConfiguration("rubyLsp") .get("rubyVersionManager")!; - private readonly shell = process.env.SHELL?.replace(/(\s+)/g, "\\$1"); private _env: NodeJS.ProcessEnv = {}; private _error = false; private readonly context: vscode.ExtensionContext; @@ -402,12 +401,8 @@ export class Ruby implements RubyInterface { private async toolExists(tool: string) { try { - let command = this.shell ? `${this.shell} -i -c '` : ""; - command += `${tool} --version`; - - if (this.shell) { - command += "'"; - } + const shell = vscode.env.shell.replace(/(\s+)/g, "\\$1"); + const command = `${shell} -i -c '${tool} --version'`; this.outputChannel.info(`Checking if ${tool} is available on the path with command: ${command}`);