Merge pull request #83 from jneidel/handle-exit

Handle EOF (ctrl-d) gracefully
This commit is contained in:
Karl Voit 2026-02-11 21:09:31 +00:00 committed by GitHub
commit fb62393a28
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -2276,7 +2276,12 @@ def ask_for_tags_text_version(vocabulary, upto9_tags_for_shortcuts, hint_str, ta
print_tag_shortcut_with_numbers(hint_str, tag_list)
logging.debug("interactive mode: asking for tags ...")
entered_tags = input(colorama.Style.DIM + 'Tags: ' + colorama.Style.RESET_ALL).strip()
try:
entered_tags = input(colorama.Style.DIM + 'Tags: ' + colorama.Style.RESET_ALL).strip()
except EOFError:
logging.info("Received EOF")
sys.exit(0)
return extract_tags_from_argument(entered_tags)