fix(client): use contains() for sentinel detection to fix Windows timeout
On Windows, cmd.exe echoes the full prompt before the command output, so the sentinel line looks like: C:\Users\Moritz\Desktop>__HELIOS_DONE__0\r\n starts_with(SENTINEL) never matched. Switching to contains() + finding the sentinel position fixes detection on both Windows and Unix.
This commit is contained in:
parent
9e6878a93f
commit
346386db99
1 changed files with 7 additions and 3 deletions
|
|
@ -119,9 +119,13 @@ impl PersistentShell {
|
|||
}
|
||||
Ok(Ok(_)) => {
|
||||
debug!("stdout line: {line:?}");
|
||||
if line.trim_end().starts_with(SENTINEL) {
|
||||
// Parse exit code from sentinel line
|
||||
let code_str = line.trim_end().trim_start_matches(SENTINEL);
|
||||
if line.contains(SENTINEL) {
|
||||
// Parse exit code from sentinel line (use contains for Windows
|
||||
// compatibility: cmd.exe echoes the prompt before the sentinel,
|
||||
// e.g. "C:\Users\...>__HELIOS_DONE__0\r\n")
|
||||
let sentinel_pos = line.find(SENTINEL).unwrap_or(0);
|
||||
let code_str = &line[sentinel_pos..];
|
||||
let code_str = code_str.trim_end().trim_start_matches(SENTINEL);
|
||||
exit_code = code_str.trim().parse().unwrap_or(0);
|
||||
break;
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue