From f5ae56ac5517b54e82e133b438f3182d1a6818a5 Mon Sep 17 00:00:00 2001 From: Adam Niederer Date: Thu, 15 Jun 2023 19:56:56 -0400 Subject: [PATCH] Clean up terminal if no matches are found --- src/main.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index 423a65e9..8daf7b27 100644 --- a/src/main.rs +++ b/src/main.rs @@ -83,7 +83,12 @@ fn run() -> Result<(), Box> { 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 => {