首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >如何在visual studio代码或VSCode中更改集成终端

如何在visual studio代码或VSCode中更改集成终端
EN

Stack Overflow用户
提问于 2016-11-08 20:51:42
回答 10查看 140.7K关注 0票数 68

我想要将集成终端更改为CMDER,我在Windows8.1上使用Vscode。我检查了文档和首选项文件,但我从以下几行中感到困惑,哪一行会更改它

//外部终端

代码语言:javascript
复制
// Customizes which terminal to run on Windows.
"terminal.external.windowsExec": "%COMSPEC%",

// Customizes which terminal application to run on OS X.
"terminal.external.osxExec": "Terminal.app",

// Customizes which terminal to run on Linux.
"terminal.external.linuxExec": "xterm",

//集成终端

代码语言:javascript
复制
// The path of the shell that the terminal uses on Linux.
"terminal.integrated.shell.linux": "sh",

// The command line arguments to use when on the Linux terminal.
"terminal.integrated.shellArgs.linux": [],

// The path of the shell that the terminal uses on OS X.
"terminal.integrated.shell.osx": "sh",

// The command line arguments to use when on the OS X terminal.
"terminal.integrated.shellArgs.osx": [],

// The path of the shell that the terminal uses on Windows. When using shells shipped with Windows (cmd, PowerShell or Bash on Ubuntu), prefer C:\Windows\sysnative over C:\Windows\System32 to use the 64-bit versions.
"terminal.integrated.shell.windows": "C:\\Windows\\system32\\cmd.exe",

// The command line arguments to use when on the Windows terminal.
"terminal.integrated.shellArgs.windows": [],

// Controls the font family of the terminal, this defaults to editor.fontFamily's value.
"terminal.integrated.fontFamily": "",

// Controls whether font ligatures are enabled in the terminal.
"terminal.integrated.fontLigatures": false,

// Controls the font size in pixels of the terminal, this defaults to editor.fontSize's value.
"terminal.integrated.fontSize": 0,

// Controls the line height of the terminal, this number is multipled by the terminal font size to get the actual line-height in pixels.
"terminal.integrated.lineHeight": 1.2,

// Controls whether the terminal cursor blinks.
"terminal.integrated.cursorBlinking": false,

// Controls whether locale variables are set at startup of the terminal, this defaults to true on OS X, false on other platforms.
"terminal.integrated.setLocaleVariables": false,

// A set of command IDs whose keybindings will not be sent to the shell and instead always be handled by Code. This allows the use of keybindings that would normally be consumed by the shell to act the same as when the terminal is not focused, for example ctrl+p to launch Quick Open.
"terminal.integrated.commandsToSkipShell": [
    "editor.action.toggleTabFocusMode",
    "workbench.action.debug.continue",
    "workbench.action.debug.restart",
    "workbench.action.debug.run",
    "workbench.action.debug.start",
    "workbench.action.debug.stop",
    "workbench.action.quickOpen",
    "workbench.action.showCommands",
    "workbench.action.terminal.clear",
    "workbench.action.terminal.copySelection",
    "workbench.action.terminal.focus",
    "workbench.action.terminal.focusNext",
    "workbench.action.terminal.focusPrevious",
    "workbench.action.terminal.kill",
    "workbench.action.terminal.new",
    "workbench.action.terminal.paste",
    "workbench.action.terminal.runSelectedText",
    "workbench.action.terminal.scrollDown",
    "workbench.action.terminal.scrollDownPage",
    "workbench.action.terminal.scrollToBottom",
    "workbench.action.terminal.scrollToTop",
    "workbench.action.terminal.scrollUp",
    "workbench.action.terminal.scrollUpPage",
    "workbench.action.terminal.toggleTerminal"
],
EN

回答 10

Stack Overflow用户

发布于 2017-05-15 23:22:08

可以在VS Code中实现这一点,并集成Cmder终端(而不是弹出窗口)。

为此,请执行以下操作:

  1. 创建指向您的Cmder目录的环境变量"CMDER_ROOT“。在VS代码中的
  2. (首选项>用户设置)中添加以下设置:

"terminal.integrated.shell.windows": "cmd.exe"

"terminal.integrated.shellArgs.windows": ["/k", "%CMDER_ROOT%\\vendor\\init.bat"]

票数 42
EN

Stack Overflow用户

发布于 2018-05-16 04:47:15

我知道已经晚了,但您只需键入Ctrl + Shift +p,然后键入default,就可以快速完成此操作,它会显示一个选项,上面写着

终端:选择默认外壳

,它将显示您可以使用的所有终端。

票数 29
EN

Stack Overflow用户

发布于 2018-08-24 15:15:45

来自Official Docs

在Windows上正确配置shell的关键是找到正确的可执行文件并更新设置。下面是常见的shell可执行文件及其默认位置的列表。

还有一个方便的命令选择默认外壳,可以通过命令调色板访问,它可以检测和设置它。

所以你可以使用ctrl+shift+p打开一个命令调色板,使用命令选择默认外壳,然后它会显示所有可用的命令行界面,选择你想要的任何东西,VS代码自动设置为你的默认集成终端。

如果你想手动设置它,找到你的cli的可执行文件的位置,打开vscode(ctrl+,)的用户设置,然后设置

代码语言:javascript
复制
"terminal.integrated.shell.windows":"path/to/executable.exe"

Windows7上的gitbash示例:

代码语言:javascript
复制
"terminal.integrated.shell.windows":"C:\\Users\\stldev03\\AppData\\Local\\Programs\\Git\\bin\\bash.exe",
票数 10
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/40487445

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档