从命令行启动 VSCode 并在集成终端中运行命令?

时间:2021-01-12 21:02:49

标签: linux shell visual-studio-code command-line terminal

标题总结了我的问题,但长篇大论是我正在尝试编写一个 shell 脚本,该脚本在特定位置打开 Visual Studio 代码,并在我刚刚打开的 VSCodes 集成终端中运行命令。 shell 脚本应如下所示:

#!/bin/bash
# Navigate to project.
cd /path/to/my/project/directory
# Start VSCode and start running react application inside integrated terminal.
code . [+ npm/yarn start]

我知道我可以打开另一个 linux 终端实例并在那里启动 react 应用程序,但我很想在集成的 VSCode 终端中启动它,因为如果 ctrl + 按下集成终端抛出的文件出现问题,调试起来会更容易错误等

有没有办法解决这个问题?

预先感谢您的帮助!

0 个答案:

没有答案
相关问题