VS Code(Windows 10)
我想从ps1脚本中实现什么:
我创建了一个Powershell脚本,该脚本从默认打开的终端运行。现在,我想从第一个打开一个新的终端标签。
我可以从终端启动vs代码命令快捷方式(Ctrl +`)或vs代码命令选项板(Ctrl + Shift + P)吗?
这是我解决问题的方法。
我创建了VS Code扩展,并使用了扩展API。
// Create a terminal Window
const term = vscode.window.createTerminal("terminal_name");
// Write any powershell command
term.sendText("cd C:\\path\\to\\follow\\");
// Any other command
term.sendText("yarn start");
// Create a second terminal
const secTerm = vscode.window.createTerminal("second_terminal_name");
secTerm.sendText("cd C:\\another\\path\\to\\follow\\");
secTerm.sendText("py manage.py runserver");
// and so one
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句