2016-11-08 126 views
23

我想要更改集成終端爲CMDER我在Windows 8.1上使用Vscode 我檢查了文檔和偏好文件,但我弄糊塗 所以從下面的行哪些行會更改如何更改視覺工作室代碼或VSCode中的集成終端

//外部端子

// 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", 

//集成終端

// 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" 
], 

回答

24

要更改Windows上的集成終端,你只需要改變terminal.integrated.shell.windows行:

  1. 打開VS用戶設置(首選項>用戶設置)。這將打開兩個並排的文件。
  2. 如果該設置尚未存在,請在右側的用戶設置文檔中添加一個新的"terminal.integrated.shell.windows": "C:\\Bin\\Cmder\\Cmder.exe"設置。這是因爲您不直接編輯默認設置,而是添加到它。
  3. 保存用戶設置文件。

你可以接着用默認鍵按Ctrl +反引號訪問它。

+1

謝謝請檢查我的其他Nexus Q還 –

+6

這仍然彈出的Cmder窗口,而不是它被集成 – Martin

+3

@Martin正如在這個問題中所寫的,https://github.com/Microsoft/vscode/issues/12006,因爲Cmder是一個終端模擬器,所以它不能被集成。你可以改用Clink。 – mbernardeau

21

可以在VS代碼中使用這個工具,並且集成Cmder終端(不彈出)。

要做到這一點:

  1. 創建一個環境變量 「CMDER_ROOT」 指向您Cmder 目錄。
  2. 在VS代碼(首選項>用戶設置)增加如下設置:

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

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

+4

這適用於Windows 10,但是我需要更改參數路徑中的斜槓:'[「/ k」,「 %CMDER_ROOT%\\ vendor \\ init.bat「]' – Lodybo

+0

與@ Lodybo的建議非常合作。謝謝! – Ben

+0

注意我實際上必須創建一個CMDER_ROOT環境變量。它不能用配置文件中的%CMDER_ROOT%替換爲init.bat的路徑 – yoyoyoyosef