fix(cli): exit app on ctrl+d when thread list is empty (#2270)

When `ctrl+d` is pressed on an empty thread list in the
`ThreadSelectorScreen`, the action was silently swallowed — the early
return fired because `_filtered_threads` was empty, but no exit
happened. Now the empty-list branch calls `app.exit()` so the keypress
behaves like a normal quit signal instead of doing nothing.
This commit is contained in:
Mason Daugherty
2026-03-27 15:57:18 -04:00
committed by GitHub
parent 0a410b4aba
commit e859077ffa
@@ -1799,7 +1799,13 @@ class ThreadSelectorScreen(ModalScreen[str | None]):
def action_delete_thread(self) -> None:
"""Show delete confirmation for the highlighted thread."""
if self._confirming_delete or not self._filtered_threads:
if self._confirming_delete:
return
if not self._filtered_threads:
# Nothing to delete — fall through to quit. Using exit() instead of
# dismiss() is intentional: dismiss() would just close the modal
# silently, re-swallowing ctrl+d.
self.app.exit()
return
self._confirming_delete = True
thread = self._filtered_threads[self._selected_index]