mirror of
https://github.com/outbackdingo/UltraGrid.git
synced 2026-03-21 06:40:15 +00:00
Win 10 term warn: don't print if stdout isn't tty
The terminal warning is neadlessly printed eg. in the GUI.
This commit is contained in:
@@ -44,10 +44,12 @@
|
||||
#include "config_win32.h"
|
||||
#endif
|
||||
|
||||
#ifndef _WIN32
|
||||
#ifdef _WIN32
|
||||
#include <io.h>
|
||||
#else
|
||||
#include <execinfo.h>
|
||||
#include <fcntl.h>
|
||||
#endif // defined _WIN32
|
||||
#endif // !defined _WIN32
|
||||
|
||||
#if __GLIBC__ == 2 && __GLIBC_MINOR__ < 27
|
||||
#include <sys/syscall.h>
|
||||
@@ -465,6 +467,7 @@ struct init_data *common_preinit(int argc, char *argv[])
|
||||
|
||||
// warn in W10 "legacy" terminal emulators
|
||||
if (getenv("TERM") == nullptr &&
|
||||
_isatty(fileno(stdout)) &&
|
||||
get_windows_build() < BUILD_WINDOWS_11_OR_LATER &&
|
||||
(win_has_ancestor_process("powershell.exe") ||
|
||||
win_has_ancestor_process("cmd.exe")) &&
|
||||
|
||||
Reference in New Issue
Block a user