vscode: If terminal.integrated.shell doesn't have a matching terminal.integrated.profiles entry the shell path will be ' '
- VS Code Version: 1.55.1
- OS Version: Windows 10 20H2 build 19042.867
Hello 👋 The Python extension uses the content of the terminal.integrated.shell.<os>
setting to determine which shell is currently used and which virtual environment activation command should be sent.
However, as reported in https://github.com/microsoft/vscode-python/issues/15919#issuecomment-820354564, if the path specified in terminal.integrated.shell.<os>
does not have a corresponding terminal.integrated.profiles.<os>
entry, the value returned by terminal.integrated.shell.<os>
will be ‘’, and terminal type detection will fail.
Steps to Reproduce:
- Install Powershell 7 in a non-standard path (for example, outside of the system drive)
- Add the path to the newly installed shell to
terminal.integrated.shell.windows
- Retrieve the value of
terminal.integrated.shell.windows
usingworkspace.getConfiguration()
Does this issue occur when all extensions are disabled?: Yes
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 17 (15 by maintainers)
Commits related to this issue
- Set default profile in exthost from renderer Fixes #121760 Related microsoft/vscode-python#16175 — committed to microsoft/vscode by Tyriar 3 years ago
@ejizba created https://github.com/microsoft/vscode/issues/128079 for that, thanks
@karrtikr you’re right, https://github.com/microsoft/vscode/pull/123174 won’t fix that because it’s actually quite a big change to make that happen which I’ve been working on most of today, I believe this is too risky to try to get into the recovery build as it involves moving a bunch of stuff around to live under different processes. It’s unfortunate that users may get confused and I’m not happy at all with the issues that came with default profiles.
I suggest once the recovery build ships (tomorrow?), in the Python extension check if the user has set
defaultProfile
but notshell
orshellArgs
and warn them that the default profile won’t be used in this case. Since https://github.com/microsoft/vscode/pull/123174 will be in the recovery build, that should catch all the bad cases@Tyriar
vscode.env.shell
returns the value ofterminal.integrated.shell.windows
instead of usingterminal.integrated.defaultProfile.windows
in combination ofterminal.integrated.profiles.windows
to get the shell path, is this expected? This is causing https://github.com/microsoft/vscode-python/issues/16175 for a lot of our users.I suspect this isn’t fixed
to verify:
using the extension terminal sample, log the values of
env.shell
andgetConfiguration().get('terminal.integrated.shell.windows')
these should be non-null and reflect what you’ve set
terminal.integrated.shell.windows
to, regardless of whether or not that path is found interminal.integrated.profiles.windows
.