Repository navigation
[Bug] Windows 无控制台宿主(pm2 后台托管)下执行 shell 工具命令会弹出 PowerShell 窗口 #1098
starkirby125918
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
环境
dsh web通过 pm2 后台托管运行(进程无控制台)现象
运行 agent 任务时,每次执行 shell 工具(pwsh / bash)命令,屏幕都会闪现一个控制台窗口后立即关闭。之前在前台终端直接运行
dsh web时无此现象。原因定位
@deepseek-ai/dsh-subprocess-local的spawnSubprocess()中调用:Windows 下未设置
windowsHide(Node 默认 false)。当父进程(dsh-web)没有控制台时(pm2 / 服务等后台托管场景),Windows 会为每个子进程新建一个可见的控制台窗口;此前前台终端运行时子进程继承终端控制台,所以不弹窗。同仓库其他组件(
dsh-native-command、dsh-host-directory-picker-native)均已正确设置windowsHide: true,唯独主 subprocess 路径漏掉了。建议修复
在 spawn options 中增加一行(与现有
detached写法同风格):影响面:所有走
ctx.subprocess的工具(dsh-tool-pwsh / dsh-tool-bash 等)在 Windows 无控制台宿主下均会弹窗。node-pty 终端路径(ConPTY)不受影响。All reactions