From 1c8d29a0589a71cb2d71362bba5d756902695043 Mon Sep 17 00:00:00 2001 From: JavaZeroo <71128095+JavaZeroo@users.noreply.github.com> Date: Sat, 31 Oct 2026 20:37:14 +0800 Subject: [PATCH] fix(shell): reopen the WSL observation window after the helper echo refs #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. --- experiments/shell/workspace_shells_scenario.hpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/experiments/shell/workspace_shells_scenario.hpp b/experiments/shell/workspace_shells_scenario.hpp index 91a03892..e6f95729 100644 --- a/experiments/shell/workspace_shells_scenario.hpp +++ b/experiments/shell/workspace_shells_scenario.hpp @@ -68,10 +68,21 @@ inline void Workspace::scenario_shells() { for(const auto group : {Group::bottom, Group::main}) for(auto& tab : group_tabs(group)) { if(!tab.launch || tab.launch->kind!=L"wsl") continue; const auto [columns,rows]=tab.shell->grid_dimensions(); + const auto marker="TF_SIZE_"+std::to_string(columns)+"x"+std::to_string(rows); + // WSL echoes the helper's command line into the same window, and conhost + // renders the helper's CRLF as ESC[row;1H, which the transport oracle + // must not treat as a record boundary (#80). Drop the echo by reopening + // the observation window once the echo is present but the marker is not, + // so the oracle judges marker plus prompt only. + 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; + } // WSL's native helper can still own console input after its marker. // Wait for its shell's fresh prompt before starting sequential exits. - if(!tf_shell_test::transport_output_completed(tab.shell->observed_output(), - "TF_SIZE_"+std::to_string(columns)+"x"+std::to_string(rows))) return false; + if(!tf_shell_test::transport_output_completed(tab.shell->observed_output(),marker)) return false; } return true; };