diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2022-01-28 23:32:57 -0800 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2022-01-28 23:32:57 -0800 |
commit | faacb12822488d6118f55f02c10887f9d670487c (patch) | |
tree | a64439b727926f85ecdef77f3e51fe7fba305286 /linenoise/linenoise.c | |
parent | 499708ec41e69fefdfee1f9db1bbcfbc7db5b87f (diff) | |
download | txr-faacb12822488d6118f55f02c10887f9d670487c.tar.gz txr-faacb12822488d6118f55f02c10887f9d670487c.tar.bz2 txr-faacb12822488d6118f55f02c10887f9d670487c.zip |
linenoise: issue newline on EOF in plain mode.
* linenoise/linenoise.c (linenoise): In plain mode, like in
full editing mode, when EOF is detected, print a newline
so that when TXR exit to an interactive shell, the shell's
prompt starts on a new line.
Diffstat (limited to 'linenoise/linenoise.c')
-rw-r--r-- | linenoise/linenoise.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/linenoise/linenoise.c b/linenoise/linenoise.c index e783a2f5..920c45d9 100644 --- a/linenoise/linenoise.c +++ b/linenoise/linenoise.c @@ -2606,6 +2606,8 @@ wchar_t *linenoise(lino_t *ls, const wchar_t *prompt) /* Not a tty: read from file / pipe. */ if (lino_os.getl_fn(ls->tty_ifs, ls->data, nelem(ls->data)) == 0) { ls->error = (lino_os.eof_fn(ls->tty_ifs) ? lino_eof : lino_ioerr); + if (!lino_os.puts_fn(ls->tty_ofs, L"\n")) + ls->error = lino_ioerr; break; } |