From 9147b35b84553af718bc3a5281c0bd68badb630a Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Sun, 15 Oct 2023 02:12:29 -0400 Subject: [PATCH] Deselect nonexistent files after commands are run --- bb.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/bb.c b/bb.c index 7b9f132..3c2b60d 100644 --- a/bb.c +++ b/bb.c @@ -364,6 +364,12 @@ static void handle_next_key_binding(bb_t *bb) fputs("\033[K", tty_out); restore_term(&orig_termios); run_script(bb, binding->script); + for (entry_t *next, *e = bb->selected; e; e = next) { + next = e->selected.next; + struct stat buf; + if (stat(e->fullname, &buf) != 0) + set_selected(bb, e, 0); + } init_term(); set_title(bb); check_cmdfile(bb);