mirror of
https://github.com/jrnl-org/jrnl.git
synced 2025-05-10 16:48:31 +02:00
Printed message aborted on ctrl+c.
This commit is contained in:
parent
b0fe7cd330
commit
065f98dda8
2 changed files with 6 additions and 6 deletions
|
@ -172,7 +172,11 @@ def run(manual_args=None):
|
|||
elif config['editor']:
|
||||
raw = util.get_text_from_editor(config)
|
||||
else:
|
||||
try:
|
||||
raw = util.py23_read("[Compose Entry; " + _exit_multiline_code + " to finish writing]\n")
|
||||
except KeyboardInterrupt:
|
||||
util.prompt("[Entry NOT saved to journal.]")
|
||||
sys.exit(0)
|
||||
if raw:
|
||||
args.text = [raw]
|
||||
else:
|
||||
|
|
|
@ -80,11 +80,7 @@ def py23_input(msg=""):
|
|||
return STDIN.readline().strip()
|
||||
|
||||
def py23_read(msg=""):
|
||||
STDERR.write(u(msg))
|
||||
try:
|
||||
return STDIN.read()
|
||||
except KeyboardInterrupt:
|
||||
sys.exit(0)
|
||||
|
||||
def yesno(prompt, default=True):
|
||||
prompt = prompt.strip() + (" [Y/n]" if default else " [y/N]")
|
||||
|
|
Loading…
Add table
Reference in a new issue