diff options
author | Benji Nguyen <45523555+solidiquis@users.noreply.github.com> | 2023-06-16 12:16:38 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-16 12:16:38 -0700 |
commit | 488c6b32d2405d9464c27cb9fac5bc119e56eaec (patch) | |
tree | 49e2bd534aad47efa6f32e05bc3a26e2a996bb11 | |
parent | 8882555fb45ebd95fc2039f681682d26ee0389d9 (diff) | |
parent | f5ae56ac5517b54e82e133b438f3182d1a6818a5 (diff) |
Merge pull request #198 from AdamNiederer/master
Clean up terminal if no matches are found
-rw-r--r-- | src/main.rs | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/main.rs b/src/main.rs index 423a65e..8daf7b2 100644 --- a/src/main.rs +++ b/src/main.rs @@ -83,7 +83,12 @@ fn run() -> Result<(), Box<dyn Error>> { let indicator = (ctx.stdout_is_tty && !ctx.no_progress).then(progress::Indicator::measure); - let (tree, ctx) = Tree::try_init_and_update_context(ctx, indicator.as_ref())?; + let (tree, ctx) = Tree::try_init_and_update_context(ctx, indicator.as_ref()).map_err(|err| { + if let Some(progress) = &indicator { + progress.mailbox().send(Message::RenderReady).unwrap() + } + err + })?; let output = match ctx.layout { layout::Type::Flat => { |