ctrl-c handled well, but not ctrl-d #95

Open
opened 2020-07-04 10:30:37 +00:00 by cmccabe · 3 comments
Owner

exiting with ctrl-d makes linkulator unhappy:

Traceback (most recent call last):
  File "/usr/local/bin/linkulator", line 514, in <module>
    main()
  File "/usr/local/bin/linkulator", line 485, in main
    menu_view_categories()
  File "/usr/local/bin/linkulator", line 357, in menu_view_categories
    menu_view_category_details(cat_index)
  File "/usr/local/bin/linkulator", line 369, in menu_view_category_details
    option = input(
EOFError
exiting with ctrl-d makes linkulator unhappy: ``` Traceback (most recent call last): File "/usr/local/bin/linkulator", line 514, in <module> main() File "/usr/local/bin/linkulator", line 485, in main menu_view_categories() File "/usr/local/bin/linkulator", line 357, in menu_view_categories menu_view_category_details(cat_index) File "/usr/local/bin/linkulator", line 369, in menu_view_category_details option = input( EOFError ```
Collaborator

This should easy enough to handle, but not sure how it should work. What is the desired behaviour if you enter End Of File immediately at a prompt?

I'm guessing the answer is to gracefully handle it, and do one of the following:

  • disregard it and prompt again for information
  • exit the current prompt
  • exit the application

Vim, man and lynx seem to disregard CTRL+D at input prompts. Maybe this is the better option?

This should easy enough to handle, but not sure how it should work. What is the desired behaviour if you enter End Of File immediately at a prompt? I'm guessing the answer is to gracefully handle it, and do one of the following: - disregard it and prompt again for information - exit the current prompt - exit the application Vim, man and lynx seem to disregard CTRL+D at input prompts. Maybe this is the better option?
Author
Owner

Ignoring it would be a decent option. The other option would be to quit linkulator as with ctrl-c. ctrl-d exits a shell session, and that is likely what someone is expecting when they enter it. But ignoring it does no harm.

Ignoring it would be a decent option. The other option would be to quit linkulator as with ctrl-c. ctrl-d exits a shell session, and that is likely what someone is expecting when they enter it. But ignoring it does no harm.
asdf added the
enhancement
label 2021-08-19 10:14:35 +00:00
asdf added the
this release
label 2021-08-22 10:23:06 +00:00

ctrl-d exits a shell session, and that is likely what someone is expecting when they enter it.

Yep! I've been "quitting" (i.e., crashing) linkulator with ctrl-d just by absentmindedly thinking it'll work like bash, and just came here to suggest exactly this kind of feature. Though, ignoring ctrl-d would at least have the benefit of letting me realize what I'm doing, and then quit it cleanly so it remembers read/unread stuff. Either way.

> ctrl-d exits a shell session, and that is likely what someone is expecting when they enter it. Yep! I've been "quitting" (i.e., crashing) linkulator with ctrl-d just by absentmindedly thinking it'll work like bash, and just came here to suggest exactly this kind of feature. Though, ignoring ctrl-d would at least have the benefit of letting me realize what I'm doing, and then quit it cleanly so it remembers read/unread stuff. Either way.
Sign in to join this conversation.
No description provided.