nano-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Nano-devel] [PATCH] startup: suggest using ^D to finish reading from st


From: Benno Schulenberg
Subject: [Nano-devel] [PATCH] startup: suggest using ^D to finish reading from standard input
Date: Sat, 28 Apr 2018 17:57:31 +0200

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

This addresses https://savannah.gnu.org/bugs/?53779.
---
 src/nano.c  | 3 ++-
 src/winio.c | 1 +
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/nano.c b/src/nano.c
index 09aacfbb..7bde6d7a 100644
--- a/src/nano.c
+++ b/src/nano.c
@@ -1107,7 +1107,7 @@ bool scoop_stdin(void)
        endwin();
        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
        /* Enable interpretation of the special control keys so that
@@ -1142,6 +1142,7 @@ bool scoop_stdin(void)
        open_buffer("", TRUE);
        read_file(stream, 0, "stdin", TRUE);
        openfile->edittop = openfile->fileage;
+       fprintf(stderr, ".\n");
 
        /* Reconnect the tty as the input source. */
        thetty = open("/dev/tty", O_RDONLY);
diff --git a/src/winio.c b/src/winio.c
index 7e338757..a285b10a 100644
--- a/src/winio.c
+++ b/src/winio.c
@@ -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
         * up the terminal settings.  So we just use vfprintf(). */
        if (isendwin()) {
+               vfprintf(stderr, "\n", ap);
                vfprintf(stderr, msg, ap);
                va_end(ap);
                return;
-- 
2.16.3




reply via email to

[Prev in Thread] Current Thread [Next in Thread]