Change break msg for Windows

for multiline input on Windows, you need Ctrl+Z to exit
This commit is contained in:
William Minchin 2013-11-27 10:07:06 -07:00
parent 6cf0651e32
commit e176e1145b

View file

@ -156,6 +156,13 @@ def cli(manual_args=None):
else: else:
journal = Journal.Journal(journal_name, **config) journal = Journal.Journal(journal_name, **config)
if "win32" in sys.platform:
# for Windows systems
_exit_multiline_code = "on a blank line, press Ctrl+Z and then Enter"
else:
# for *nix systems (and others?)
_exit_multiline_code = "press Ctrl+D"
if mode_compose and not args.text: if mode_compose and not args.text:
if not sys.stdin.isatty(): if not sys.stdin.isatty():
# Piping data into jrnl # Piping data into jrnl
@ -163,7 +170,7 @@ def cli(manual_args=None):
elif config['editor']: elif config['editor']:
raw = get_text_from_editor(config) raw = get_text_from_editor(config)
else: else:
raw = util.py23_read("[Compose Entry, press Ctrl+D to finish writing]\n") raw = util.py23_read("[Compose Entry; " + _exit_multiline_code + " to finish writing]\n")
if raw: if raw:
args.text = [raw] args.text = [raw]
else: else: