`vscode.env.shell` might return empty string to extension if fetched very soon after startup
See original GitHub issueType: Bug
Seems to be a timing issue. The following steps sometimes reproduce it for me, but success may depend on the performance of your workstation (mine is Windows) and which other extensions are enabled by default.
- Clone https://github.com/gjsjohnmurray/vscode-extension-samples/tree/show-160694
- Open the statusbar-sample folder in VS Code
- Open a Terminal in that folder and run
npm install
- Switch to Debug view, choose the
ONLY Extension
configuration and run it. This launches with--disable-extensions
- When Extension Host window appears, look on the right of the status bar. If the repro was successful it will look like this:
If this doesn’t happen, try the next steps:
- End debugging and launch the
Extension
configuration instead. This launches normally and probably won’t trigger the problem:
- From Command Palette of the EH window, run
Developer: Reload With Extensions Disabled
. With luck this will cause the problem to happen (see first screenshot).
The extension activates "*"
, so immediately on startup. The first attempt to get vscode.env.shell
happens from its activate
method.
If the problem shows, click the status bar panel to get the value again. This time it should succeed.
VS Code version: Code - Insiders 1.72.0-insider (835ace5796cec0ed19a7eec119b26b57220b0f1a, 2022-09-12T05:16:16.290Z) OS version: Windows_NT x64 10.0.22000 Modes: Sandboxed: Yes
Issue Analytics
- State:
- Created a year ago
- Comments:18 (18 by maintainers)
Top Results From Across the Web
VS Code API | Visual Studio Code Extension API
VS Code API is a set of JavaScript APIs that you can invoke in your Visual Studio Code extension. This page lists all...
Read more >September 2022 (version 1.72) - Visual Studio Code
Learn what is new in the Visual Studio Code September 2022 Release (1.72)
Read more >November 2022 (version 1.74) - Visual Studio Code
Install an extension located on disk command. The command will open the platform folder dialog to select the location of the extension's ....
Read more >User and Workspace Settings - Visual Studio Code
Note: VS Code extensions can also add their own custom settings, and those ... Or, if workbench.settings.editor is set to json , now...
Read more >Troubleshoot Terminal launch failures - Visual Studio Code
Troubleshooting steps · Test your shell directly. Try running your designated integrated terminal shell outside VS Code from an external terminal or command ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@meganrogge since things can be achieved with this upcoming change (check
creationOptions
orenv.shell
/onDidChangeShell
), I’m not sure we want to add more to the API just to handle this case.Leaving this open for future finalization