tweaks: check for the type of terminal far earlier

So the result could be used during RC-file reading.
This commit is contained in:
Benno Schulenberg 2018-01-12 09:51:43 +01:00
parent 4bcce96a4f
commit c1bb6485de

View File

@ -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