Skip to content
Snippets Groups Projects
Commit dfd0521e authored by Paul Smith's avatar Paul Smith Committed by Brad King
Browse files

Terminal: Support GNU make's TTY notification environment variable

Starting with release 4.0, GNU make provides for collecting recipe
output and printing it all at once after the recipe is complete, as
well as ensuring that only one rule is printing output at a time.
This allows parallel builds without mangled output.

However, it means that programs run by make do not have a TTY for
their stdout or stderr: make is collecting this.

GNU make 4.1 and above will set an environment variable MAKE_TERMOUT
to a non-empty value if make believes that after it's done collecting
stdout, the results will be displayed on a TTY.

This patch teaches KWsys to check that environment variable and if
set, proceed as if output is going to a TTY.
parent d4cecd6a
No related branches found
No related tags found
No related merge requests found
......@@ -172,6 +172,14 @@ static int kwsysTerminalStreamIsVT100(FILE* stream, int default_vt100,
}
}
/* GNU make 4.1+ may tell us that its output is destined for a TTY. */
{
const char* termout = getenv("MAKE_TERMOUT");
if (termout && *termout != '\0') {
return 1;
}
}
/* If running inside emacs the terminal is not VT100. Some emacs
seem to claim the TERM is xterm even though they do not support
VT100 escapes. */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment