mirror of
https://github.com/outbackdingo/UltraGrid.git
synced 2026-03-21 12:40:19 +00:00
Windows: issue a warning for PWSH/cmd term only in W10
Do not issue the warning over PowerShell or cmd legacy terminal emulators
in Windows 11. In Window the check doesn't work, because the process
tree is different - the Windows Terminal doesn't have its own process
and it is uv.exe->powershell.exe->exporer.exe.
This improves commit bb2a72f67f.
This commit is contained in:
@@ -462,10 +462,11 @@ struct init_data *common_preinit(int argc, char *argv[])
|
||||
}
|
||||
|
||||
// warn in W10 "legacy" terminal emulators
|
||||
if ((win_has_ancestor_process("powershell.exe") ||
|
||||
if (getenv("TERM") == nullptr &&
|
||||
get_windows_build() < BUILD_WINDOWS_11_OR_LATER &&
|
||||
(win_has_ancestor_process("powershell.exe") ||
|
||||
win_has_ancestor_process("cmd.exe")) &&
|
||||
!win_has_ancestor_process("WindowsTerminal.exe") &&
|
||||
getenv("TERM") == nullptr) {
|
||||
!win_has_ancestor_process("WindowsTerminal.exe")) {
|
||||
MSG(WARNING, "Running inside PS/cmd terminal is not recommended "
|
||||
"because scrolling the output freezes the process, "
|
||||
"consider using Windows Terminal instead!\n");
|
||||
|
||||
Reference in New Issue
Block a user