如何在vscode中添加"terminal.integrated.shellArgs.windows":
时间: 2024-03-20 20:45:10 浏览: 26
您可以按照以下步骤在 VS Code 中添加 "terminal.integrated.shellArgs.windows":
1. 打开 VS Code 并打开用户设置(File > Preferences > Settings)。
2. 在搜索栏中输入 "terminal.integrated.shellArgs.windows"。
3. 点击 "Edit in settings.json"。
4. 在打开的 settings.json 文件中,找到 "terminal.integrated.shellArgs.windows" 的设置。
5. 如果该设置不存在,则可以在文件中添加以下行:
```
"terminal.integrated.shellArgs.windows": [
"/K",
"echo Hello World"
]
```
6. 将 "echo Hello World" 替换为您想要在终端中运行的命令。
7. 保存并关闭文件。
现在,当您在 VS Code 中打开终端时,它将使用您指定的参数来运行默认的 Windows 终端。
相关问题
VSCode 启动禁止terminal显示上次执行记录
你可以在 VSCode 中打开设置(快捷键为 Ctrl + ,),然后搜索 "terminal.integrated.shellArgs.windows"(如果你是在 Windows 上使用 VSCode)或 "terminal.integrated.shellArgs.osx"(如果你是在 macOS 上使用 VSCode),将其设置为:
```json
"terminal.integrated.shellArgs.windows": ["-NoProfile"],
"terminal.integrated.shellArgs.osx": ["-l"]
```
这将禁止在终端中显示上次执行的记录。
java在vscode中的打印时配置成中文
在 VS Code 中,Java 打印输出默认是使用系统默认编码进行输出的,如果想要输出中文,则需要将编码设置为 UTF-8。
可以在 `launch.json` 文件中添加一个 `"vmArgs"` 的配置项,指定 JVM 的启动参数,例如:
```json
{
"type": "java",
"name": "Launch Current File",
"request": "launch",
"mainClass": "${file}",
"vmArgs": "-Dfile.encoding=UTF-8"
}
```
上面的配置将指定 JVM 使用 UTF-8 编码进行输出,这样就可以正确输出中文了。
另外,如果想要在控制台中正确显示中文,也需要将终端的编码设置为 UTF-8。可以在 VS Code 的设置中搜索 `terminal.integrated.shellArgs.windows` 配置项,将其修改为:
```json
"terminal.integrated.shellArgs.windows": [
"-ExecutionPolicy",
"Bypass",
"-NoExit",
"-Command",
"chcp 65001"
]
```
这样在打开终端时,会自动将编码设置为 UTF-8,就可以正确显示中文了。
相关推荐
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)