vscode: First Terminal Does Not Follow Default
Issue Type: Bug
My terminal.integrated.defaultProfile.linux setting is zsh.
However, when VSCode first starts, when it re-starts, or after opening a project, the Terminal window opens with -bin/tcsh
, as shown in the attached.
Logging out of this shell and then creating a new one will correctly launch a zsh, but the first one comes up with tcsh.
This is a duplicate of #142220, which was closed because I had been associating the issue with Python and Virtualenv. However, this problem exists even when neither of those are enabled for the project.
VS Code version: Code - Insiders 1.65.0-insider (Universal) (97c1e76d668d23d568044feb31083407f4c4b1ed, 2022-02-07T08:54:27.868Z) OS version: Darwin x64 21.3.0 Restricted Mode: No Remote OS version: Linux x64 3.10.0-1062.1.2.el7.x86_64
System Info
Item | Value |
---|---|
CPUs | Intel® Core™ i7-9750H CPU @ 2.60GHz (12 x 2600) |
GPU Status | 2d_canvas: enabled gpu_compositing: enabled metal: disabled_off multiple_raster_threads: enabled_on oop_rasterization: enabled opengl: enabled_on rasterization: enabled skia_renderer: disabled_off_ok video_decode: enabled webgl: enabled webgl2: enabled |
Load (avg) | 2, 2, 2 |
Memory (System) | 16.00GB (0.25GB free) |
Process Argv | –crash-reporter-id 006e15b5-a669-4bc7-a1f6-95633fbbc2b2 |
Screen Reader | no |
VM | 0% |
Item | Value |
---|---|
Remote | SSH: scv-bphunter01.csg.apple.com |
OS | Linux x64 3.10.0-1062.1.2.el7.x86_64 |
CPUs | Intel® Xeon® Gold 6136 CPU @ 3.00GHz (2 x 2992) |
Memory (System) | 7.64GB (2.07GB free) |
VM | 100% |
Extensions (23)
Extension | Author (truncated) | Version |
---|---|---|
vscode-select-by-indent | hab | 0.3.0 |
vscode-peacock | joh | 4.0.0 |
remote-ssh | ms- | 0.70.0 |
sublime-keybindings | ms- | 4.0.10 |
vs-qalc | nor | 0.1.8 |
jinja-snippets | nox | 1.0.0 |
material-icon-theme | PKi | 4.12.1 |
rewrap | stk | 1.16.1 |
jinja | who | 0.0.8 |
increment-selection | alb | 0.2.0 |
clock | ang | 1.0.1 |
better-toml | bun | 0.3.2 |
systemverilog | eir | 0.11.3 |
search-editor-apply-changes | jak | 0.1.1 |
align-by-regex | jan | 1.0.4 |
git-graph | mhu | 1.30.0 |
perforce | mjc | 4.15.2 |
vscode-text-tables | Rom | 0.1.5 |
vscode-paste-and-indent | Rub | 0.0.8 |
todotasks | san | 0.5.0 |
sort-lines | Tyr | 1.9.1 |
change-case | wma | 1.0.0 |
markdown-all-in-one | yzh | 3.4.0 |
(2 theme extensions excluded)
A/B Experiments
vsliv695:30137379
vsins829:30139715
vsliv368cf:30146710
vsreu685:30147344
python383cf:30185419
vspor879:30202332
vspor708:30202333
vspor363:30204092
pythonvspyl392:30422396
pythontb:30258533
pythonptprofiler:30281269
vshan820:30294714
pythondataviewer:30285072
vscod805:30301674
pythonvspyt200:30323110
bridge0708:30335490
bridge0723:30353136
vsaa593:30376534
pythonvs932:30404738
wslgetstartedc:30421358
vscop453:30404998
vsclayoutctrc:30405799
pythonvsnew555:30426298
vscscmwlcmt:30428973
azactmsalcf:30432849
vscgsvidc:30433759

About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 14
- Comments: 15 (1 by maintainers)
This happens to me intermittently on Windows. I believe it can only happen to the very first terminal of any given VS Code window when launching from upon a completely new/fresh launch of VS Code (if you already have a VS Code instance/window open, it will not happen).
In my case, I have Git Bash setup as the default, but the first time I launch VS Code, when this happens, it makes the terminal a PowerShell. I can hit the
+
sign and it will be Git Bash on any following terminal. If I hit the dropdown, it shows Git Bash is the default.I get inconsistent behavior and it seems to happen more often when many windows are being launched, which appears to cause the total VS Code launch time to increase by quite a bit, and that may be what is driving this to happen.
file/exit
with multiple VS Code windows open, it will close all of them, and then if you launch VS Code after that, it will open all the prior windows at once.It seems there is a loading-order race condition where the config setting that tells VS Code which terminal is a default may not have loaded yet at the time a window is creating the terminal, the first time VS Code launches, if there is enough stuff going on at startup from many extensions and multiple windows being opened at once. (or something like that).
Here’s the rest of the info generated by my Issue Reporter:
VS Code version: Code 1.65.2 (c722ca6c7eed3d7987c0d5c3df5c45f6b15e77d1, 2022-03-10T14:33:55.248Z) OS version: Windows_NT x64 10.0.18363 Restricted Mode: No
System Info
gpu_compositing: enabled
multiple_raster_threads: enabled_on
oop_rasterization: enabled
opengl: enabled_on
rasterization: enabled
skia_renderer: enabled_on
video_decode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
Extensions (59)
A/B Experiments
I think this is no longer happening on: Version: 1.70.2 (system setup) Commit: e4503b30fc78200f846c62cf8091b76ff5547662 Date: 2022-08-16T05:35:13.448Z Electron: 18.3.5 Chromium: 100.0.4896.160 Node.js: 16.13.2 V8: 10.0.139.17-electron.0 OS: Windows_NT x64 10.0.19044
I’m having a very similar bug (though not exactly the same, it’s likely the same thing just different observed behaviour)
https://github.com/microsoft/vscode/issues/144825#issue-1165001031
I´ve found a temporary[^1] workaround 🎉 (don´t solves the core problem)
Instead of configuring your default shell/ terminal the recommended way by setting
terminal.integrated.profiles.linux
andterminal.integrated.defaultProfile.linux
in your remote machinessettings.json
like hereuse the deprecated way of setting the default terminal (which fixes the bug for me 🙌):
You can use both solutions at the same time so all your profiles are accessible when launching new terminals after VSCode is up and running. [^1]: This will not work forever as the config used is deprecated
I have removed terminal.integrated.profiles.windows from my user settings. Now when I open vscode I get my preferred terminal specified in terminal.integrated.defaultProfile.windows