Skip to content

Commit 7c54436

Browse files
Revert "fix(cli): Stream REPL output as it arrives instead of buffering."
This reverts commit f220c39.
1 parent f220c39 commit 7c54436

1 file changed

Lines changed: 6 additions & 10 deletions

File tree

cli/src/engine.rs

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -78,19 +78,15 @@ impl Session {
7878
let expr = format!("__edgeRun({literal})");
7979
self.tab.evaluate(&expr, false).map_err(|e| anyhow!("starting eval: {e}"))?;
8080

81-
// Stream lines as they arrive; suppress the first `history_lines` (replayed history, already shown in prior evals) with a counter instead of buffering the whole run.
82-
let skip = self.history_lines;
83-
let mut seen = 0usize;
84-
let outcome = drain(&self.tab, &mut |line| {
85-
if seen >= skip {
86-
on_line(line);
87-
}
88-
seen += 1;
89-
})?;
81+
let mut all: Vec<String> = Vec::new();
82+
let outcome = drain(&self.tab, &mut |line| all.push(line.to_string()))?;
83+
for line in all.iter().skip(self.history_lines) {
84+
on_line(line);
85+
}
9086
if outcome.err.is_none() {
9187
if !self.history.is_empty() { self.history.push('\n'); }
9288
self.history.push_str(src);
93-
self.history_lines = seen;
89+
self.history_lines = all.len();
9490
}
9591
Ok(outcome)
9692
}

0 commit comments

Comments
 (0)