Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

I installed fish shell on my computer and now I can't open the VS code terminal [closed]

I installed fish shell on my computer and now I can't open the VS code terminal.

When I try to open the terminal on VS code, I get the following error: "The terminal process failed to launch: Path to shell executable "/usr/bin/fish" does not exist."

I have no problems with opening the terminal from outside VS code. And when I enter the echo "$SHELL" command on it, I get /usr/bin/fish which is exactly the path VS code isn't able to find.

How could I fix this problem? I'm using ubuntu.

like image 390
German Cocca Avatar asked Aug 30 '21 14:08

German Cocca


People also ask

Why VS Code is not opening from terminal?

Some terminal launch failures may be due to your shell installation and are not specific to VS Code. The exit codes displayed come from the shell and you may be able to diagnose shell issues by searching on the internet for the specific shell and exit code. Use the most recent version of VS Code.

How do I open the shell in VS Code?

You can easily open it by hitting Ctrl + ` key.


1 Answers

I had this same problem. The issue is that VSC only looks for shells in /usr/bin by default. I copied the default terminal settings and updated fish to where brew installs it: /usr/local/bin

"terminal.integrated.profiles.osx": {
    "bash": {
        "path": "bash",
        "args": [
            "-l"
        ],
        "icon": "terminal-bash"
    },
    "zsh": {
        "path": "zsh",
        "args": [
            "-l"
        ]
    },
    "fish": {
        "path": "/usr/local/bin/fish", // overriding
        "args": [
            "-l"
        ]
    }
},

This should be the same for other OSes, you'll just want linux or windows instead of osx.

fish running in VS Code terminal

To get to that setting, open up your settings (cmd comma on mac or ctrl comma elsewhere), search for terminal profiles: Settings search and click edit in settings.json. It should take you right to the correct spot to paste in these profiles.

like image 84
Caleb Avatar answered Oct 20 '22 19:10

Caleb