Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/visual-studio-code/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Visual studio code 是否有方法更改使用键绑定Ctrl+时打开的shell;班次+;Visual Studio代码中的c?_Visual Studio Code - Fatal编程技术网

Visual studio code 是否有方法更改使用键绑定Ctrl+时打开的shell;班次+;Visual Studio代码中的c?

Visual studio code 是否有方法更改使用键绑定Ctrl+时打开的shell;班次+;Visual Studio代码中的c?,visual-studio-code,Visual Studio Code,我在键盘快捷键设置中注意到了这段代码。 {“键”:“ctrl+shift+c”,“命令”:“workbench.action.terminal.openNativeConsole”}, 我想知道,我是否可以将其更改为打开Powershell而不是打开cmd.exe?目前,定制更倾向于更改触发操作的键/条件,而不是添加新操作 能够创建自定义操作也将是一件非常棒的事情,VisualStudio代码团队也有兴趣听取他们的想法 我添加了一个。截至2016年2月,仍然没有设置,但您可以使用CodeSh

我在键盘快捷键设置中注意到了这段代码。

{“键”:“ctrl+shift+c”,“命令”:“workbench.action.terminal.openNativeConsole”},


我想知道,我是否可以将其更改为打开Powershell而不是打开cmd.exe?

目前,定制更倾向于更改触发操作的键/条件,而不是添加新操作

能够创建自定义操作也将是一件非常棒的事情,VisualStudio代码团队也有兴趣听取他们的想法


我添加了一个。

截至2016年2月,仍然没有设置,但您可以使用
CodeShell
扩展,安装后使用
Ctrl-Alt-p
在项目文件夹的根目录下启动PowerShell窗口。

从v1.1.0开始,我们现在可以配置外部shell

在版本1.6.1之前,只有一个设置

"externalTerminal.windowsExec": "powershell"
从版本1.6.1开始,有一个外部和内部端子设置。使用值“%COMSPEC%”,可以更改其COMSPEC环境变量

// 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"
但是,我发现它打开了32位Powershell.exe。对我来说,它没有设置执行策略。所以我用下面的方法设置它

我提升了权限(Powershell版本的sudo):

然后,在新提升的Powershell窗口中:

Set-ExecutionPolicy RemoteSigned

1.6.1Nice中的terminal.external.windowsExec
。它现在默认为%COMSPEC%,因此可以通过环境变量进行配置。我想知道从CMD.exe更改会导致什么样的混乱。如果您使用的是64位Visual Studio代码,则不要使用sysnative,因为sysnative是一个虚拟文件夹,一个特殊别名,可用于从32位应用程序或脚本访问64位System32文件夹。使用instad命令打开System32文件夹。
Set-ExecutionPolicy RemoteSigned