Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Keyboard interrupt not handled when waiting for user input #67

Closed
jose1711 opened this issue Nov 18, 2023 · 3 comments
Closed

Keyboard interrupt not handled when waiting for user input #67

jose1711 opened this issue Nov 18, 2023 · 3 comments

Comments

@jose1711
Copy link
Contributor

To reproduce:

  • start calcure
  • hit a to add event (but note that d or r works too)
  • press ctrl+c

Receive KeyboardInterrupt message:

..
  File "/usr/lib/python3.11/site-packages/calcure/__main__.py", line 1066, in cli
    curses.wrapper(main)
  File "/usr/lib/python3.11/curses/__init__.py", line 94, in wrapper
    return func(stdscr, *args, **kwds)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/calcure/__main__.py", line 1025, in main
    control_monthly_screen(stdscr, screen, user_events, importer)
  File "/usr/lib/python3.11/site-packages/calcure/controls.py", line 39, in inner
    confirmed = ask_confirmation(stdscr, MSG_EXIT, cf.ASK_CONFIRMATIONS)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/calcure/dialogues.py", line 99, in ask_confirmation
    key = stdscr.getkey()
          ^^^^^^^^^^^^^^^
_curses.error: no input
@anufrievroman
Copy link
Owner

Indeed, I was aware of this possibility for a while. I think I should write an error handling decorator in dialogues.py module.

@jose1711
Copy link
Contributor Author

Thanks, I believe user should be given an option to use Ctrl+c as a way of terminating the current action. Example:

  • user hits x
  • status line: Delete event number: (^c to abort)
  • user realizes error, hits ctrl+c
  • nothing happens, status line updates to Aborted

anufrievroman added a commit that referenced this issue Nov 20, 2023
@anufrievroman
Copy link
Owner

Fixed it with commit 013b520

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants