feedback: print helpful message only when data comes from keyboard

When the data is fed to nano through a pipe, it is pointless to print
this message as it can be seen only after nano has exited.

This addresses https://savannah.gnu.org/bugs/?56348.
master
Benno Schulenberg 2019-05-19 19:44:27 +02:00
parent 4f1eb5fdd4
commit 9e182722cc
1 changed files with 4 additions and 2 deletions

View File

@ -1065,8 +1065,10 @@ bool scoop_stdin(void)
endwin();
tcsetattr(0, TCSANOW, &oldterm);
fprintf(stderr, _("Reading from standard input; type ^D or ^D^D to finish.\n"));
/* When input comes from a terminal, show a helpful message. */
if (isatty(0))
fprintf(stderr, _("Reading data from keyboard; "
"type ^D or ^D^D to finish.\n"));
#ifndef NANO_TINY
/* Enable interpretation of the special control keys so that
* we get SIGINT when Ctrl-C is pressed. */