vscode 的命令行工具执行后如何后台运行?-灵析社区

七安前

目前使用了 vscode 的隧道功能,在服务器端使用 code tunnel 启动隧道,然后就可以在本地直接对服务器端的文件进行编辑。但是要执行 code tunnel 需要先使用终端连接上服务器,执行完命令后终端会被挂起 ![](https://wmlx-new-image.oss-cn-shanghai.aliyuncs.com/images/20241110/16a24fa15b5f6d7289cf5fb14e04d054.png) 如果直接关闭终端,那么隧道会被断开。 有没有方法可以让 code tunnel 执行后在后台运行,这样就可以关闭终端并保持隧道。

阅读量:13

点赞量:0

问AI
使用 "code tunnel service install" 和 "code tunnel service uninstall"。 «How can I ensure I keep my tunnel running? You have a few options:* Use the "service" command to run as a service. You can run "code tunnel service install" and "code tunnel service uninstall" to install and remove them. * Use the "no-sleep" option, "code tunnel --no-sleep", to prevent your remote machine from going to sleep.» "https://code.visualstudio.com/docs/remote/tunnels#_how-can-i-..." (https://link.segmentfault.com/?enc=GnzrL0bnxUcv7UFMpt3EDA%3D%3D.P%2BPAtMu7%2B5yj4c2SWBrO9lr48LUfy3E60qWuDYQsJqfphKu6oARjDALraOYyPNCZvREMGT77d5pdpMkh5Jeh7vz3Z9ag%2BTYVNActUecQxuNBrN4X9%2F5vzCw51MTLQDhE)