startup: suggest using ^D to finish reading from standard input

Also, add a period after the "Read nn lines" message, and
don't let the next shell prompt overwrite this message.

This addresses https://savannah.gnu.org/bugs/?53779.
master
Benno Schulenberg 2018-04-28 17:50:51 +02:00
parent f1530c7ba0
commit 0da554e6d7
2 changed files with 3 additions and 1 deletions

View File

@ -1107,7 +1107,7 @@ bool scoop_stdin(void)
endwin(); endwin();
tcsetattr(0, TCSANOW, &oldterm); tcsetattr(0, TCSANOW, &oldterm);
fprintf(stderr, _("Reading from stdin, ^C to abort\n")); fprintf(stderr, _("Reading from standard input; type ^D or ^D^D to finish.\n"));
#ifndef NANO_TINY #ifndef NANO_TINY
/* Enable interpretation of the special control keys so that /* Enable interpretation of the special control keys so that
@ -1142,6 +1142,7 @@ bool scoop_stdin(void)
open_buffer("", TRUE); open_buffer("", TRUE);
read_file(stream, 0, "stdin", TRUE); read_file(stream, 0, "stdin", TRUE);
openfile->edittop = openfile->fileage; openfile->edittop = openfile->fileage;
fprintf(stderr, ".\n");
/* Reconnect the tty as the input source. */ /* Reconnect the tty as the input source. */
thetty = open("/dev/tty", O_RDONLY); thetty = open("/dev/tty", O_RDONLY);

View File

@ -2159,6 +2159,7 @@ void statusline(message_type importance, const char *msg, ...)
/* Curses mode is turned off. If we use wmove() now, it will muck /* Curses mode is turned off. If we use wmove() now, it will muck
* up the terminal settings. So we just use vfprintf(). */ * up the terminal settings. So we just use vfprintf(). */
if (isendwin()) { if (isendwin()) {
fprintf(stderr, "\n");
vfprintf(stderr, msg, ap); vfprintf(stderr, msg, ap);
va_end(ap); va_end(ap);
return; return;