zulip-terminal: Add popup to confirm exiting the application

I raised a concern over this some time ago in #zulip-terminal>Confirm before exiting? #T1341; see there for motivation.

The design for this could be as follows:

  • reuse our existing confirmation popup to trigger on the exit keypress, instead of it directly exiting the application
  • enable this by default, but add a configuration file option to specify a preference
  • perhaps also a command-line option, to both enable and disable it (eg. to support default=confirm, config=no-confirm, command-line=confirm)

The first step of these would be a good first issue, and if that goes well the later points could be included in the first PR or follow-up(s).

The exit keypress (QUIT) is listed in the help but doesn’t connect to a specific event like most other symbolic keys (eg. HELP), since it is actually us setting the Ctrl c (SIGINT) signal handler in core.py which controls what happens here. Intercepting that flow of functions would be the first thing to try.

We may later want to explore a different approach where we block that signal completely in the same way that we block Ctrl+z/s, and then use regular keypress handling instead, though if the urwid main loop blocks then we may lose the ability to shut down as cleanly.

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Comments: 23 (7 by maintainers)

Most upvoted comments

@prateek-719 @rsashank Reassigning due to the intention to continue the recent work; see the topic in #zulip-terminal for further discussion.

Yes, I’m planning to continue working on this. I’ll be making a PR soon, if possible can the issue be re-assigned?