vscode配置bash
时间: 2023-04-29 12:06:21 浏览: 148
如何配置VSCode来使用Bash?
1. 确认已安装Bash:在终端中输入“bash”并按下回车键,若有相应的响应则证明已经安装。
2. 安装VSCode插件:“Bash Debug”和“Shell Launcher”。
3. 在VSCode中打开一个Bash脚本(.sh文件)。
4. 按下F5键,选择“Bash”调试配置。
5. 在.vscode/launch.json文件中添加配置信息:
{
"type": "bashdb",
"request": "launch",
"name": "Bash Debug",
"program": "${workspaceFolder}/filename.sh",
"args": [],
"stopOnEntry": false,
"env": {},
"cwd": "${workspaceFolder}",
}
6. 如果需要在VSCode中打开终端,需要在settings.json文件中添加以下快捷键绑定:
{
"workbench.action.terminal.toggleTerminal": {
"key": "ctrl+`",
"when": "!terminalFocus"
},
"workbench.action.terminal.scrollDown": {
"key": "shift+down",
"when": "terminalFocus"
},
"workbench.action.terminal.scrollUp": {
"key": "shift+up",
"when": "terminalFocus"
}
}
7. 按下快捷键ctrl+`,打开终端。
8. 在终端中输入“bash”,使用Bash。
注意:以上方法适用于Windows和Linux系统。Mac用户需要安装不同的插件和调试器。
阅读全文
相关推荐
















