Skip to content

fix(shell): WSL 观察窗口避让命令回显 (#80) - #290

Merged
JavaZeroo merged 1 commit into
mainfrom
fix/shells-wsl-window
Oct 31, 2026
Merged

JavaZeroo merged 1 commit into
mainfrom
fix/shells-wsl-window

Conversation

@JavaZeroo

Copy link
Copy Markdown
Owner

内容

WSL 会话的 size helper 回显会把观察窗口弄脏,而 oracle 不允许把 ESC[row;1H 当作记录边界(既有合同明确禁止)。本次在场景层解决:

// workspace_shells_scenario.hpp 的 sizes_ready()
const auto observed = tab.shell->observed_output();
if (observed.find("shell_size_client") != std::string::npos &&
    observed.find(marker) == std::string::npos) {
    tab.shell->begin_output_observation();   // 丢掉回显,重开窗口
    return false;
}

判据为什么是这两个条件

条件 作用
observed 含 shell_size_client 回显已经出现(即命令真的发出去了)
observed 不含 marker 标记还没到,此时重开不会丢失标记

两个条件同时成立才重开,避免了"标记已到却被清掉"的漏检。

为什么不在 oracle 里改

transport_completion_test 有三条合同用例,明确要求带 ESC[6;1H/ESC[7;1H 的回显前缀不得被当作换行:

CUP cannot discard an echo prefix to invent marker output
CUP cannot discard a prompt and echo prefix
CUP does not turn command echo into output

改 oracle 会直接违反这三条,因此只能在场景层"让窗口干净"。

验证

  • termforge_shell 构建通过;
  • test_local_shell_exit_waits_for_native_helper_return 与 test_local_shell_launch_working_directory_and_cleanup 本机通过(2 tests OK)。

边界

  • 只影响 WSL 分支,cmd/pwsh/powershell 三条已通过路径不变;
  • 本机 WSL 未必复现 CI 的 185B 窗口,最终确认仍需 CI 对照;
  • 未修改 oracle、未放宽任何判定。

Refs #80

…efs #80

The transport oracle must not treat ESC[row;1H as a record boundary, so the scenario drops the command echo from the window instead.
@JavaZeroo
JavaZeroo merged commit dc34ac0 into main Oct 31, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant