I've 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?
All keyboard shortcuts in VS Code can be customized via the keybindings. json file. To configure keyboard shortcuts through the JSON file, open Keyboard Shortcuts editor and select the Open Keyboard Shortcuts (JSON) button on the right of the editor title bar. This will open your keybindings.
Press the TAB key repeatedly until the cursor is in the Press new shortcut key box. Press the combination of keys that you want to assign. For example, press CTRL plus the key that you want to use.
Starting in v1.1.0, we can now configure the external shell.
Before version 1.6.1, there was only one setting.
"externalTerminal.windowsExec": "powershell"
Starting with version 1.6.1, there is an external and internal terminal setting. Using the value "%COMSPEC%", one could instead change their COMSPEC environment variable.
// 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, however, that it opens the 32bit Powershell.exe. Which, for me, did not have its execution policy set. So I set it using the following...
I elevated my permissions (Powershell's version of sudo):
Start-Process Powershell -Verb Runas
Then, in the new elevated Powershell window:
Set-ExecutionPolicy RemoteSigned
At the moment, the customization is more geared towards changing the keys / conditions that trigger the actions, rather than adding new actions.
It would be great to be able to create custom actions too - and the Visual Studio Code team are interested in hearing ideas on their User Voice site.
I have added a suggestion for custom actions.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With