Repository navigation
Closed
Labels
bugIssue identified by VS Code Team member as probable bughelp wantedIssues identified as good community contribution opportunitiesinsiders-releasedPatch has been released in VS Code InsiderslinuxIssues with VS Code on LinuxmacosIssues with VS Code on MAC/OS Xterminal-profilesverifiedVerification succeeded
Milestone
Description
Type: Bug
I have followed the instructions to install fish with homebrew on my Apple Silicon mac. Fish is the default shell in any terminal and added to /etc/shells.
When starting VS Code and opening a terminal, it chooses zsh as my default. Even with forced defaultProfile.osx settings and overridden profiles.osx settings.
Fish is also not shown in the profiles list when selecting another terminal profile.
VS Code version: Code 1.83.1 (f1b07bd, 2023-10-10T23:57:32.750Z)
OS version: Darwin arm64 23.0.0
Modes:
System Info
| Item | Value |
|---|---|
| CPUs | Apple M1 (8 x 24) |
| GPU Status | 2d_canvas: enabled canvas_oop_rasterization: enabled_on direct_rendering_display_compositor: disabled_off_ok gpu_compositing: enabled multiple_raster_threads: enabled_on opengl: enabled_on rasterization: enabled raw_draw: disabled_off_ok video_decode: enabled video_encode: enabled vulkan: disabled_off webgl: enabled webgl2: enabled webgpu: enabled |
| Load (avg) | 2, 2, 2 |
| Memory (System) | 16.00GB (0.16GB free) |
| Process Argv | |
| Screen Reader | no |
| VM | 0% |
Extensions (46)
| Extension | Author (truncated) | Version |
|---|---|---|
| vscode-nginx-conf | ahm | 0.3.2 |
| github-markdown-preview | bie | 0.3.0 |
| vscode-fish | bma | 1.0.37 |
| vscode-intelephense-client | bme | 1.9.5 |
| vscode-eslint | dba | 2.4.2 |
| gitlens | eam | 14.4.0 |
| EditorConfig | Edi | 0.16.4 |
| prettier-vscode | esb | 10.1.0 |
| copy-relative-path-and-line-numbers | ezf | 0.3.1 |
| shell-format | fox | 7.2.5 |
| copilot | Git | 1.126.0 |
| copilot-chat | Git | 0.8.0 |
| todo-tree | Gru | 0.0.226 |
| prettier-sql-vscode | inf | 1.6.0 |
| vscode-just | kok | 2.1.0 |
| restructuredtext | lex | 189.3.0 |
| rainbow-csv | mec | 3.7.1 |
| dotenv | mik | 1.0.1 |
| vscode-filesize | mkx | 3.1.0 |
| vscode-docker | ms- | 1.27.0 |
| vscode-language-pack-de | MS- | 1.83.2023101109 |
| remote-containers | ms- | 0.315.1 |
| remote-ssh | ms- | 0.106.5 |
| remote-ssh-edit | ms- | 0.86.0 |
| remote-explorer | ms- | 0.4.1 |
| remote-server | ms- | 1.4.3 |
| vscode-just-php-cs-fixer | muu | 0.6.2 |
| vscode-sundial | muu | 3.4.1 |
| gremlins | nho | 0.26.0 |
| vscode-xml | red | 0.26.1 |
| vscode-yaml | red | 1.14.0 |
| git-autoconfig | shy | 0.0.2 |
| svg-preview | Sim | 2.8.3 |
| code-spell-checker | str | 3.0.1 |
| code-spell-checker-german | str | 2.2.1 |
| vscode-stylelint | sty | 1.2.4 |
| even-better-toml | tam | 0.19.2 |
| simple-rst | tro | 1.5.4 |
| sort-lines | Tyr | 1.11.0 |
| vscodeintellicode | Vis | 1.2.30 |
| vscode-swiftformat | vkn | 1.6.7 |
| vscode-icons | vsc | 12.5.0 |
| php-debug | xde | 1.33.0 |
| pretty-ts-errors | yoa | 0.5.2 |
| save-as-root | yy0 | 1.7.0 |
| markdown-all-in-one | yzh | 3.5.1 |
(1 theme extensions excluded)
Metadata
Metadata
Assignees
Labels
bugIssue identified by VS Code Team member as probable bughelp wantedIssues identified as good community contribution opportunitiesinsiders-releasedPatch has been released in VS Code InsiderslinuxIssues with VS Code on LinuxmacosIssues with VS Code on MAC/OS Xterminal-profilesverifiedVerification succeeded
Activity
muuvmuuv commentedon Oct 17, 2023
muuvmuuv commentedon Oct 17, 2023
Opening code from the command line works, so it won't be any extension.
meganrogge commentedon Oct 17, 2023
This suggests either the location of fish is not discoverable to us due to some admin privileges associated with it or it's at a non standard path.
Where is fish located for you?
muuvmuuv commentedon Oct 17, 2023
I have installed it with Homebrew so /opt/homebrew/bin/fish. Bin is in path and I set default shell as well as appended it to /etc/shells.
meganrogge commentedon Oct 17, 2023
here's where my
fishis/usr/local/bin/fishand it's working there. not sure for your case - but what happens if you create a profile,muuvmuuv commentedon Oct 18, 2023
Funny... if I let autocomplete in settings paste the default it includes fish but if I open the command prompt it doesn't show it as selection ^^
muuvmuuv commentedon Oct 18, 2023
Megan Rogge (@meganrogge) this works, yes. But I don't want to specify every shell, on another machine I may prefer something else and this would force it across my synced devices.
9 remaining items
[-]Cannot use fish shell[/-][+]Terminal profile default discovery isn't working as expected[/+]nkramber commentedon Oct 4, 2026
I'd like to work on this. I reproduced it on current
main(macOS, fish 4.9.3 from Homebrew at/opt/homebrew/bin/fish, VS Code launched from the Dock rather than the CLI).Root cause. The default
fishprofile has the bare pathfish, and bare names are only looked up on the PATH of the resolved shell environment:vscode/src/vs/platform/terminal/node/terminalProfiles.ts
Lines 479 to 490 in 5983cda
That environment is resolved by running
$SHELLas a login shell. If that fails or times out, the pty host uses{}and the lookup falls back to launchd's/usr/bin:/bin:/usr/sbin:/sbin:vscode/src/vs/platform/terminal/node/ptyHostService.ts
Lines 129 to 141 in 5983cda
So whenever
/opt/homebrew/binisn't on that PATH, thefishprofile is dropped. It disappears from the picker, anddefaultProfile.osx: "fish"can't match it, so it silently falls back to$SHELL:vscode/src/vs/workbench/contrib/terminal/browser/terminalProfileService.ts
Lines 131 to 133 in 5983cda
That matches every symptom in the report:
defaultProfile.osx: "fish": afterchsh, apps launched from the Dock can still get the old$SHELL=/bin/zshuntil you log out, and zsh's PATH lacks/opt/homebrew/binwhenbrew shellenvonly lives inconfig.fish.Even with a correct
$SHELL=fish, a failed resolution means you get the generated fallback (fishwithout-l) instead of thefishprofile.Proposed fix (
terminalProfiles.tsonly, plus a unit test):$SHELL(resolved env and process) plusos.userInfo().shell. The latter reads the user database, so it's current even when the GUI session's$SHELLpredateschsh.terminalProfiles.test.tsshowing that afishprofile not on PATH is found through the login shell, and that other bare names (e.g.tmux) aren't.$SHELLwhendefaultProfileis unset, shell-env resolution, and Windows.Megan Rogge (@meganrogge) two non-blocking questions:
/opt/homebrew/bin,/usr/local/bin) so Homebrewtmux/pwshare found too?fish. OK?Find terminal profiles at the login shell path when it's not on PATH (m…
terminal: resolve login shell candidates without blocking