Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to have the Integrated Terminal open automatically on start of Visual Studio Code?

Tags:

Is it possible to configure User Settings to have the Integrated Terminal to start automatically when opening Visual Studio Code?

like image 350
Isak La Fleur Avatar asked Aug 30 '17 10:08

Isak La Fleur


People also ask

How do I open Visual Studio integrated terminal from command prompt?

Start in Visual StudioOn the menu bar, select Tools > Command Line > Developer Command Prompt or Developer PowerShell.


2 Answers

There is now an extension that lets you set terminals on startup, and even works with split terminal views!

https://marketplace.visualstudio.com/items?itemName=EthanSK.restore-terminals

ps i wrote it

like image 171
Ethan SK Avatar answered Oct 13 '22 07:10

Ethan SK


As of VS Code v1.45.0, the experimental configuration mentioned in this other answer should now be the default behavior for VS Code. Just make sure to save your files/folders in a workspace. See the What is a VS Code "workspace"? section of the VS Code docs.

VS Code remembers the last state of your workspace and restores it. If I have the Integrated Terminal panel opened before I closed the window, it gets reopened when I reload or reopen the workspace (I can't seem to find the setting for this though). So basically, the Integrated Terminal is already auto displayed. (I use Ubuntu 18 and macOS 10.15.)

If you have a specific terminal setup (ex. multiple terminals opened to different directories, python envs, workspaces, etc.), you could check out Terminals Manager which is for "setting-up multiple terminals at once" and can be configured to auto-run on startup.

You just need to add a terminals.json file in your workspace (under .vscode) with something like this, and set autorun to true. This would auto-run the extension's Terminals: Run command on startup to auto-load your terminals.

{
    "autorun": true,
    "autokill": true,
    "terminals": [
        {
            "name": "GIT",
            "description": "For running git commands",
            "open": true,
            "focus": true,
            "commands": [
                "pwd",
                "git fetch -v"
            ]
        },
        {
            "name": "BUILD",
            "description": "For running build commands",
            "open": true,
            "focus": false,
            "commands": [
                "cd apps",
                "./clean.sh"
            ]
        },
        {
            "name": "SCRIPTS",
            "description": "For running python commands",
            "open": true,
            "focus": false,
            "commands": [
                "source $VENV_DIR/test-py38/bin/activate",
                "python -V"
            ]
        },
    ]
}
like image 45
Gino Mempin Avatar answered Oct 13 '22 07:10

Gino Mempin