Skip to content

Commit d4fa730

Browse files
committed
Fix REPL not reseting on Ctrl-C issue
1 parent fba20cd commit d4fa730

2 files changed

Lines changed: 6 additions & 0 deletions

File tree

src/repl/core.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,11 @@ impl ReplCore {
3434
}
3535
}
3636

37+
pub fn reset(&mut self) {
38+
self.input.clear();
39+
self.parser = ReplParser::new();
40+
}
41+
3742
pub fn input_line(&mut self, line: &str) -> ReplOutput {
3843
self.input.push_str(line);
3944

src/repl/terminal/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ impl TerminalRepl {
132132
// probably handle it one level up? That could help for the other
133133
// panics as well.
134134
let _ = terminal_io.enter();
135+
self.core.reset();
135136
self.reset_input();
136137
self.redraw(terminal_io);
137138
return ReplControl::Continue;

0 commit comments

Comments
 (0)