- 标题自定义编辑:HISTORY 详情按 e 编辑标题,UserTitle 持久化到缓存且最高优先级 - AI 摘要质量修复:困惑回复检测词表收紧,消息提取过滤噪音,修复 JSON 包裹困惑回复漏网 - 数据维护命令:--fix-titles 清理低质量摘要,--regen-summaries 并发生成 - 修复代码审查 9 个问题:退格 UTF-8 损坏、中文输入、flush 调度、误杀合法摘要、 按键全局拦截、UserTitle 未同步窗口标题、wt 启动回落、cmd 注入防护、前缀误隐藏会话 - 启动链 wt.exe 回退与 cmd start 标题转义 - gofmt 规范化,新增 launch_test.go
23 lines
800 B
Go
23 lines
800 B
Go
package internal
|
||
|
||
import (
|
||
"strings"
|
||
"testing"
|
||
)
|
||
|
||
// TestWtExeNeverReturnsBareName 锁定 wtExe 的契约:要么返回真实路径,要么返回空串,
|
||
// 绝不能返回裸 "wt.exe"。
|
||
// 裸 "wt.exe" 在未安装 Windows Terminal 的机器上会让 exec.Command 启动报
|
||
// `exec: "wt.exe": executable file not found in %PATH%`(v0.2.2 的崩溃根因)。
|
||
// 空串触发 launchInWtWithTitle 的 cmd /c start 独立窗口回退。
|
||
func TestWtExeNeverReturnsBareName(t *testing.T) {
|
||
got := wtExe()
|
||
if got == "wt.exe" {
|
||
t.Fatalf("wtExe() returned bare %q; must return full path or empty string", got)
|
||
}
|
||
if got != "" && !strings.HasSuffix(got, "wt.exe") {
|
||
t.Fatalf("wtExe() returned unexpected path %q", got)
|
||
}
|
||
t.Logf("wtExe() = %q (empty ⇒ wt absent → cmd fallback)", got)
|
||
}
|