Wsl兼容问题#1
Open
HarriethWiKk wants to merge 6 commits into
Hidden character warning
The head ref may contain hidden characters: "WSL\u517c\u5bb9\u95ee\u9898"
Open
Conversation
…级、escape timeout 修正、临时目录清理 - 可靠终端尺寸检测 (getReliableTerminalSize) 替代裸取 stdout.columns/rows - stdin.isTTY 守卫 + try/catch 防止 setRawMode 异常 - alternate screen 退出前擦除 + 光标保存/恢复,防止 conhost 残留 - \r 替换为 CSI G (\x1B[G),避免 WSL icrnl 翻译为 \r\n - Intl.Segmenter try/catch + code-point 降级,防止 ICU 缺失崩溃 - chalk.level 替换为 shouldUseAsciiFallback(),保守检测 conhost - escapeTimeoutMs 默认值 40→80ms,与注释推荐值一致 - 外部编辑器临时目录 rmSync 递归清理,防止 WSL2 /tmp 残留 - package.json engines.node 放宽为 >=22,兼容 Node 22 CI 环境
问题根因:/exit handler 只调了 ctx.shutdown(),但 shutdown() 设计上不调用
process.exit()(注释明确写了 'callers should do so after cleanup'),导致
进程没有退出,TUI 的 stdin 监听器仍在运行,按回车会重复渲染终端边框。
修复:/exit 和 /quit handler 现在按完整清理链路执行:
1. app.commitStatic('Session saved. Goodbye!') — 输出告别信息
2. app.dispose() — 恢复终端状态(bracketed paste off, raw mode off, resize dispose)
3. ctx.shutdown() — 清理 agent/session(已存在的)
4. process.exit(0) — 真正退出进程(之前缺失的)
Co-Authored-By: HarrieWiKk <2473281470@qq.com>
移除 getReliableTerminalSize、safeColumns、effectiveCols/Rows 等终端尺寸 可靠检测逻辑。恢复使用 stdout.columns/rows 原始值、\r 替代 CSI G、 移除 terminal-capabilities.ts 及 shouldUseAsciiFallback。 保留:v2.15.0 plan picker 改动、/exit app.dispose() + process.exit(0)
【欢迎屏动态降级】 - 四级宽度降级:full(≥60) → compact-no-border(≥30) → single-line(≥16) - 北斗星图/ASCII logo 在窄屏自动替换为单行文字 - 元信息标准化:统一用 | 分隔,超长字段自动截断 - 快捷键折叠:默认显示4项关键快捷键 + '… +4 more' 提示 【快捷键 overlay】 - 新增 renderShortcutsOverlay:按分类展示全部快捷键 - 输入框输入 ? 自动打开快捷键总览 overlay - 新增 /shortcuts slash 命令 【状态栏三段式视觉分离】 - 保留现有边框系统(boxCharsFor) - 输入行高亮增强:slash 模式用 primary 色,streaming 用 dim,idle 用星域 accent
- GlanceBar 从输入框顶边框提取为独立状态行 - 状态行与输入框之间增加 ─ 分隔线 - 输入框边框简化为纯色框(不再嵌入指标) - 输入框边框颜色动态反映状态:slash=primary, streaming=dim, idle=星域accent
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.