commit c1bb6485de91eb661b527b0fd849e4ac653411fa
parent 4bcce96a4ff24275c5dde455263fe21bf076e5da
Author: Benno Schulenberg <bensberg@telfort.nl>
Date: Fri, 12 Jan 2018 09:51:43 +0100
tweaks: check for the type of terminal far earlier
So the result could be used during RC-file reading.
Diffstat:
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/src/nano.c b/src/nano.c
@@ -1980,6 +1980,11 @@ int main(int argc, char **argv)
{NULL, 0, NULL, 0}
};
+#ifdef __linux__
+ /* Check whether we're running on a Linux console. */
+ console = (getenv("DISPLAY") == NULL);
+#endif
+
/* Back up the terminal settings so that they can be restored. */
tcgetattr(0, &oldterm);
@@ -2471,11 +2476,6 @@ int main(int argc, char **argv)
/* Set up the terminal state. */
terminal_init();
-#ifdef __linux__
- /* Check whether we're running on a Linux console. */
- console = (getenv("DISPLAY") == NULL);
-#endif
-
#ifdef DEBUG
fprintf(stderr, "Main: set up windows\n");
#endif