commit 19a833c94e2066750d1ca3cca7ec538ed40b83ed
parent 169da8aec0a649e4f0ebc121baf236e3a28ab9f3
Author: Benno Schulenberg <bensberg@telfort.nl>
Date: Wed, 13 Mar 2019 19:12:07 +0100
startup: check again for a Linux console after reading all files
When there is a dash among the files on the command line, nano will read
data from standard input, which means that the latter is not connected to
a terminal and thus cannot be recognized as a Linux VT until nano has
finished reading the input and has reconnected the input source to the
terminal.
The first probe for a Linux VT is kept in place for now, so that nano
can stop when there are errors in an rcfile while running on a VT.
(This stopping will not work when data is read from standard input,
of course, but that is a smaller fish.)
This fixes https://savannah.gnu.org/bugs/?55912.
Reported-by: Enrico Mioso <mrkiko.rs@gmail.com>
Bug existed since the recognition of modified cursor keys on a Linux
console was introduced, in version 2.6.3, commit 290d278f.
Diffstat:
1 file changed, 5 insertions(+), 0 deletions(-)
diff --git a/src/nano.c b/src/nano.c
@@ -2685,6 +2685,11 @@ int main(int argc, char **argv)
}
#endif
+#ifdef __linux__
+ /* Check again whether we're running on a Linux console. */
+ on_a_vt = (ioctl(0, VT_GETSTATE, &dummy) == 0);
+#endif
+
#ifdef DEBUG
fprintf(stderr, "Main: show title bar, and enter main loop\n");
#endif