Customize VSCode to use a console emulator instead

2019-05-02 20:22发布

问题:

Can I customize VSCode to use a console emulator instead of the command prompt?

I want to use something like conemu, but don't want to use "force conemu as default terminal for console applications" setting in conemu.

It has a specific warning "enabling this option may cause false alarms in antiviral programs", and I'm on my work computer.

回答1:

They have just implemented this feature:

https://github.com/Microsoft/vscode/pull/3495

You'll have the externalTerminal.windowsExec and externalTerminal.linuxExec user settings, where you can define what console emulator to use.

In my case, I'm on windows using conEmu. My user settings (settings.json) are configured like follows:

{
    "externalTerminal.windowsExec": "conEmu64.exe"
}

EDIT: It's already available in the stable version.



回答2:

I just wrote a simple extension that overrides key binding Ctrl/Cmd+Shift+C with command console.open defined by this extension.

https://marketplace.visualstudio.com/items/vilicvane.console

It's not working with "Open in Command Prompt" context menu item though.