Cómo cambiar el terminal integrado en visual studio code o VSCode


Quiero cambiar el terminal integrado a CMDER uso Vscode en Windows 8.1 revisé el doc y también el archivo de preferencias, pero me confundí así que de las siguientes líneas que la línea va a cambiar

// Terminal Externo

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

// Terminal Integrado

// 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"
],
Author: Gama11, 2016-11-08

5 answers

Para cambiar el terminal integrado en Windows, solo necesita cambiar la línea terminal.integrated.shell.windows:

  1. Abrir VS Configuración de usuario (Preferencias > Configuración de usuario). Esto abrirá dos documentos lado a lado.
  2. Agregue una nueva configuración "terminal.integrated.shell.windows": "C:\\Bin\\Cmder\\Cmder.exe" al documento de configuración de usuario a la derecha si aún no está allí. Esto es para que no edite la Configuración predeterminada directamente, sino que la agregue.
  3. Guarde el archivo de configuración del usuario.

A continuación, puede acceder a él con las teclas Ctrl+backtick por defecto.

 31
Author: mbernardeau,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2016-11-08 14:46:17

Es posible hacer que esto funcione en el Código VS y tener el terminal Cmder integrado (no emergente).

Para hacerlo:

  1. Cree una variable de entorno "CMDER_ROOT" que apunte a su Cmder directorio.
  2. En (Preferencias > Configuración de usuario) en VS Code agregue la siguiente configuración:

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

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

 30
Author: khernand,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2017-10-13 18:49:24

Sé que es tarde, pero puede lograrlo rápidamente con solo escribir Ctrl + Shift + p y luego escribir default, mostrará una opción que dice

Terminal: Seleccione Shell por defecto

, entonces mostrará todos los terminales disponibles para usted.

 9
Author: etp23,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2018-05-15 20:47:14

De Documentos oficiales

Configurar correctamente su shell en Windows es una cuestión de localización el ejecutable correcto y la actualización de la configuración. A continuación se muestra una lista de ejecutables de shell comunes y sus ubicaciones predeterminadas.

También existe el comando convenience Select Default Shell que puede ser se accede a través de la paleta de comandos que puede detectar y establecer esto para usted.

Para que pueda abrir una paleta de comandos usando ctrl+shift+p, utilice el command Seleccione Default Shell, luego muestra todas las interfaces de línea de comandos disponibles, seleccione lo que desee, VS code establece que como terminal integrado por defecto para usted automáticamente.

Si desea configurarlo manualmente, encuentre la ubicación del ejecutable de su cli y abra la configuración de usuario de vscode (ctrl+,), luego configure

"terminal.integrated.shell.windows":"path/to/executable.exe"

Ejemplo para gitbash en windows7:

"terminal.integrated.shell.windows":"C:\\Users\\stldev03\\AppData\\Local\\Programs\\Git\\bin\\bash.exe",
 2
Author: Mohana Naga Venkat Sayempu,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2018-08-24 07:15:45

La forma oficial se describe en VS Code docs , que es similar a la respuesta de khernands.

Si no desea establecer CMDER_ROOT como una variable de entorno global, puede hacerlo en este archivo por lotes. Además, el cd en el dir de trabajo actual al final resolvió un problema de ruta para mí.

Sin embargo, me encontré con una limitación con CMDER como terminal integrado por defecto: No funciona si desea ejecutar tareas a través de la paleta de comandos - > "Ejecutar tarea" comando de Código VS Interfaz de usuario (como "Ejecutar tarea de compilación"). Más sobre este aquí y aquí.

En este caso, simplemente establezca el shell para la tarea específica:

"tasks": [
    {
        "type": "typescript",
        "tsconfig": "tsconfig.json",
        "problemMatcher": [
            "$tsc"
        ],
        "options": {
            "shell": {
                "executable": "cmd.exe",
                "args": [
                    "/d", "/c"
                ]
            }
        }
    }
]
 -1
Author: ford04,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2018-08-03 18:19:15