mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-07-01 11:32:48 -05:00
New Windows utility function: is_console_handle().
Rather like isatty() on Unix, this tells you if a raw Windows HANDLE points at a console or not. Useful to know if your standard output or standard error is going to be shown to a user, or redirected to something that will make automated use of it.
This commit is contained in:
@ -267,3 +267,11 @@ bool platform_sha1_hw_available(void)
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
bool is_console_handle(HANDLE handle)
|
||||
{
|
||||
DWORD ignored_output;
|
||||
if (GetConsoleMode(handle, &ignored_output))
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
Reference in New Issue
Block a user