Skip to content

Commit 4268d09

Browse files
branchseerclaude
andcommitted
fix(vite_pty): add EOF handling to read_until
Add missing EOF check when n == 0 to prevent infinite loop. All tests now pass on both macOS (8/8) and Windows (8/8). Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
1 parent 9e4e8ef commit 4268d09

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

crates/vite_pty/src/terminal.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,11 @@ impl Terminal {
116116
// Not found yet - read more data
117117
let n = self.reader.read(&mut buf)?;
118118

119+
if n == 0 {
120+
// EOF - expected string not found
121+
return Err(anyhow::anyhow!("Expected string not found: {}", expected));
122+
}
123+
119124
let data = &buf[..n];
120125
// Feed data to parser, which updates screen state and handles control sequence queries.
121126
self.parser.process(data);

0 commit comments

Comments
 (0)