Skip to content

Commit

Permalink
give a little ui feedback for slow commands
Browse files Browse the repository at this point in the history
  • Loading branch information
sigmaSd committed Sep 27, 2024
1 parent 654775f commit 5a7e32e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions crates/irust/src/irust/engine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,9 @@ impl IRust {
// Some commands that uses raw writer depends on this (exp: add, edit)
// This is also important to move the cursor after the all the input
self.printer.write_newline(&self.buffer);
// Flush output so we give the user a little ui feedback, that something happened
// This is relevent for slow commands (easy example: sleep(5))
std::io::Write::flush(&mut self.printer.writer.raw)?;

let buffer = self.buffer.to_string();
if let Some(cmd) = self.output_event_hook(&buffer) {
Expand Down

0 comments on commit 5a7e32e

Please sign in to comment.