Suppressing transient console windows when spawning child processes on Windows for the Feishu/Lark messenger bridge.
Raw Developer Origin & Technical Request
GitHub Issue
May 26, 2026
## 问题描述
Windows 上运行 `lark-channel-bridge` 时,每次 bridge 收到飞书消息并 spawn `claude` 子进程,屏幕上都会闪现一个黑色控制台窗口然后立刻消失。频繁聊天时比较打扰。
## 环境
- OS: Windows 11 Pro 10.0.26200
- bridge 版本: 0.1.32
- 启动方式: `start-bridge.vbs` 后台拉起 `npx -y lark-channel-bridge@latest run`
- 子进程入口: `claude.cmd`(stepcode 包装)
## 根因
`dist/cli.js:1053` spawn claude 子进程时,options 没传 `windowsHide: true`:
```js
const child = spawn(this.binary, args, {
cwd: opts.cwd,
env: { ...process.env, LARK_CHANNEL: "1" },
stdio: ["ignore", "pipe", "pipe"]
// ← 缺 windowsHide: true
});
```
因为 `this.binary` 是 `.cmd` 包装(claude/stepcode/lark-cli 都走这种入口),Node 在 Windows 下 spawn `.cmd` 默认会瞬间新建控制台窗口,cmd 把控制权交给 node.exe 后退出 —— 用户看到的就是"黑窗一闪而过"。
## 修复
加一行 `windowsHide: true`:
```js
const child = spawn(this.binary, args, {
cwd: opts.cwd,
env: { ...process.env, LARK_CHANNEL: "1" },
stdio: ["ignore", "pipe", "pipe"],
windowsHide: true
});
```
本地打了这个补丁,验证可消除闪窗。
文件里其他 spawn 调用(如 `cli.js:1698` 给 lark-cli 用的)如果也面向 `.cmd` 入口,建议一并加上。
## 参考
- Node.js docs: [child_process — `options.windowsHide`](nodejs.org/api/child_process...
感谢作者做出这么趁手的桥!
Developer Debate & Comments
No active discussions extracted for this entry yet.
Adjacent Repository Pain Points
Other highly discussed features and pain points extracted from zarazhangrui/feishu-claude-code-bridge.
Frequently Asked Questions
Market intelligence mapped to Suppressing transient console windows when spawning child processes on Windows for the Feishu/Lark messenger bridge..
How is Suppressing transient console windows when spawning child processes on Windows for the Feishu/Lark messenger bridge. positioned in the market?
Which technical concepts are associated with Suppressing transient console windows when spawning child processes on Windows for the Feishu/Lark messenger bridge.?
What open-source repositories focus on Suppressing transient console windows when spawning child processes on Windows for the Feishu/Lark messenger bridge.?
Engagement Signals
Cross-Market Term Frequency
Quantifies the cross-market adoption of foundational terms like Node.js and stdio by tracking occurrence frequency across active SaaS architectures and enterprise developer debates.
SaaS Metrics