Is there a way to change the shell that opens when using the keyboard shortcut Ctrl + Shift + c in Visual Studio code?

I noticed this code in the keyboard shortcut settings. { "key": "ctrl+shift+c", "command":"workbench.action.terminal.openNativeConsole" },

I was wondering, instead of opening cmd.exe, can I change it to open Powershell?

+7
visual-studio-code
source share
3 answers

Starting with version 1.1, we can now configure the external shell.

Prior to version 1.6.1, there was only one setting.

 "externalTerminal.windowsExec": "powershell" 

Starting with version 1.6.1, there is an external and internal configuration of the terminal. Using the value "% COMSPEC%", you can change their COMSPEC environment variable instead.

 // 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.external.windowsExec": "C:\\WINDOWS\\System32\\WindowsPowerShell\\v1.0\\powershell.exe", // 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\\WindowsPowerShell\\v1.0\\powershell.exe" 

I found that it was opening the 32-bit Powershell.exe file. For me, I did not have an established execution policy. So I installed it using the following ...

I elevated my rights (sudo Powershell version):

 Start-Process Powershell -Verb Runas 

Then in a new enlarged Powershell window:

 Set-ExecutionPolicy RemoteSigned 
+4
source share

At the moment, the setting is more focused on changing the keys / conditions that trigger actions, rather than adding new actions.

It would also be great to create custom actions - and the Visual Studio Code team is interested in hearing ideas on their User Voice site .

I added a suggestion for custom actions .

+3
source share

There is no installation yet since February 2016, but you can use the CodeShell extension and after installation use Ctrl-Alt-P to launch the PowerShell window in the root of the project folder.

0
source share

All Articles