🔴 [H8] 初始文件加载失败 → 终端状态损坏 #8
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
文件:
tui/main.rs:17-30分类: 终端安全
问题: 先启用 raw mode + alternate screen,再加载文件。加载失败时调用
process::exit(1),绕过所有终端恢复逻辑,导致用户 shell 不可用。建议修复: 使用 RAII guard(
TerminalGuard),Drop时恢复终端;文件加载移到终端初始化之前。Fixed in
b7938e0. RAII TerminalGuard with Drop cleanup. 88 tests pass. tmux integration test verified terminal restored on error exit (exit code 1) and normal exit (exit code 0).