How to select a different type of command shell in the Visual Studio Code integrated terminal

后端 未结 3 2005
别跟我提以往
别跟我提以往 2021-02-07 22:13

I looked at this link which talks about changing the default command shell in the integrated terminal of Visual Studio Code. I was successfully able to change it to Git Bash usi

相关标签:
3条回答
  • 2021-02-07 22:37

    No need to keep changing your default terminal setting. Install the Shell Launcher extension, configure it, and then ctrl-shift-t to select which terminal you want to open inside of VS Code.

    0 讨论(0)
  • 2021-02-07 22:42

    As of June 17 '2018, things have become really smooth in Visual Studio Code when it comes to changing the integrated command shell. I'm enlisting all the options here:

    1. Select a different command shell on the go - Name of the command shell is itself a command to switch the current command shell to the target command shell. For example, let's say my integrated command shell is currently showing Bash, and I want to switch to PowerShell right away. Then type the command powershell, press Enter and the command shell changes to PowerShell. Similarly it works for all other types of command shells installed in your product.
    2. More instances of command shell - Just press Ctrl + Shift + `(back-tick). Every time you press the keyboard shortcut combination, a new instance of the command shell will get added.
    3. Change the configuration of default command shell type - Press F1 in Visual Studio Code and type or select Terminal: Select Default Shell as shown in the snapshot below.

    Terminal Selection

    Once selected, then choose the default command shell of your choice to change the settings permanently:

    Terminal Selection

    0 讨论(0)
  • 2021-02-07 22:51

    In recent version (1.15.0) you can

    • change the settings, then run the terminal, you've set
    • then change the settings again and run the another type of terminal by pressing the + sign
    • and so on...

    You can put this in your settings file, and uncomment which one you need.

    // 64-bit cmd if available, otherwise 32-bit
    //"terminal.integrated.shell.windows": "C:\\Windows\\sysnative\\cmd.exe"
    // 64-bit PowerShell if available, otherwise 32-bit
    //"terminal.integrated.shell.windows": "C:\\Windows\\sysnative\\WindowsPowerShell\\v1.0\\powershell.exe"
    // Git Bash
    "terminal.integrated.shell.windows": "C:\\Program Files\\Git\\bin\\bash.exe"
    // Bash on Ubuntu (on Windows)
    //"terminal.integrated.shell.windows": "C:\\Windows\\sysnative\\bash.exe"
    
    0 讨论(0)
提交回复
热议问题