How to change the integrated terminal in visual studio code or VSCode

前端 未结 8 856
轮回少年
轮回少年 2020-12-12 21:46

I want to change integrated terminal to CMDER i use Vscode on windows 8.1 i checked the doc and also preference file but i got confuse so from following line

相关标签:
8条回答
  • 2020-12-12 22:08

    For OP's terminal Cmder there is an integration guide, also hinted in the VS Code docs.

    If you want to use VS Code tasks and encounter problems after switch to Cmder, there is an update to @khernand's answer. Copy this into your settings.json file:

    "terminal.integrated.shell.windows": "cmd.exe",
    
    "terminal.integrated.env.windows": {
      "CMDER_ROOT": "[cmder_root]" // replace [cmder_root] with your cmder path
    },
    "terminal.integrated.shellArgs.windows": [
      "/k",
      "%CMDER_ROOT%\\vendor\\bin\\vscode_init.cmd" // <-- this is the relevant change
      // OLD: "%CMDER_ROOT%\\vendor\\init.bat"
    ],
    

    The invoked file will open Cmder as integrated terminal and switch to cmd for tasks - have a look at the source here. So you can omit configuring a separate terminal in tasks.json to make tasks work.

    Starting with VS Code 1.38, there is also "terminal.integrated.automationShell.windows" setting, which lets you set your terminal for tasks globally and avoids issues with Cmder.

    "terminal.integrated.automationShell.windows": "cmd.exe"
    
    0 讨论(0)
  • 2020-12-12 22:08

    Probably it is too late but the below thing worked for me:

    1. Open Settings --> this will open settings.json
    2. type terminal.integrated.windows.shell
    3. Click on {} at the top right corner -- this will open an editor where this setting can be over ridden.
    4. Set the value as terminal.integrated.windows.shell: C:\\Users\\<user_name>\\Softwares\\Git\\bin\\bash.exe
    5. Click Ctrl + S

    Try to open new terminal. It should open in bash editor in integrated mode.

    0 讨论(0)
  • 2020-12-12 22:11

    I know is late but you can quickly accomplish that by just typing Ctrl + Shift + p and then type default, it will show an option that says

    Terminal: Select Default Shell

    , it will then display all the terminals available to you.

    0 讨论(0)
  • 2020-12-12 22:12

    If you want to change the external terminal to the new windows terminal, here's how.

    0 讨论(0)
  • 2020-12-12 22:20

    I was successful via settings > Terminal > Integrated > Shell: Linux

    from there I edited the path of the shell to be /bin/zsh from the default /bin/bash

    • there are also options for OSX and Windows as well

    @charlieParker - here's what i'm seeing for available commands in the command pallette

    0 讨论(0)
  • 2020-12-12 22:23

    To change the integrated terminal on Windows, you just need to change the terminal.integrated.shell.windows line:

    1. Open VS User Settings (Preferences > User Settings). This will open two side-by-side documents.
    2. Add a new "terminal.integrated.shell.windows": "C:\\Bin\\Cmder\\Cmder.exe" setting to the User Settings document on the right if it's not already there. This is so you aren't editing the Default Setting directly, but instead adding to it.
    3. Save the User Settings file.

    You can then access it with keys Ctrl+backtick by default.

    0 讨论(0)
提交回复
热议问题