C:\Users\LENOVO\.dsh\profiles\web\node_modules\node-pty\lib\conpty_console_list_agent.js:13
var consoleProcessList = getConsoleProcessList(shellPid);
^
Error: AttachConsole failed
at Object.<anonymous> (conpty_console_list_agent.js:13:26)
at Module._compile (node:internal/modules/cjs/loader:1872:14)
...
Node.js v24.19.0
Bug Report:终端在 Windows 服务环境下 node-pty
AttachConsole failed崩溃omdsh-dev/DSH-better-sidebar环境
dsh-better-sidebar0.12.1(依赖node-pty ^1.1.0)现象
WindowsPtyAgent._getConsoleProcessList()forkconpty_console_list_agent.js,子进程AttachConsole失败,抛完整 Node 崩溃栈写入~/.dsh/logs/dsh-web.err.log。崩溃栈
触发场景
代码位置
node-pty/lib/windowsPtyAgent.js:140, 181-184:spawn 后调用_getConsoleProcessList()→child_process.fork(conpty_console_list_agent, [innerPid])node-pty/lib/conpty_console_list_agent.js:13:AttachConsole(shellPid)失败未容错,直接抛错退出建议
AttachConsole失败时降级(返回空列表 / 忽略),而不是崩溃退出。