diff options
author | Anatol Belski <ab@php.net> | 2017-07-24 14:47:32 +0200 |
---|---|---|
committer | Anatol Belski <ab@php.net> | 2017-07-24 14:47:32 +0200 |
commit | 8a6afbef3f003e8faaeb560f9a7dbfbf7a8b1568 (patch) | |
tree | 8f1b3536aae30ac55d5d43fd8473ef7d0fd28646 /win32/console.c | |
parent | 742895f60c82f2caa22e933606a4807c73ca6851 (diff) | |
download | php-git-8a6afbef3f003e8faaeb560f9a7dbfbf7a8b1568.tar.gz |
Combine conditions for the automatic interactive console activation
as with bug #74979 it seems to have regressions which were not
present before.
Diffstat (limited to 'win32/console.c')
-rw-r--r-- | win32/console.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/win32/console.c b/win32/console.c index c321a37023..0d52fd12d8 100644 --- a/win32/console.c +++ b/win32/console.c @@ -94,10 +94,18 @@ PHP_WINUTIL_API BOOL php_win32_console_fileno_set_vt100(zend_long fileno, BOOL e PHP_WINUTIL_API BOOL php_win32_console_is_own(void) {/*{{{*/ - CONSOLE_SCREEN_BUFFER_INFO csbi; + if (!IsDebuggerPresent()) { + CONSOLE_SCREEN_BUFFER_INFO csbi; + DWORD pl[1]; + BOOL ret0 = FALSE, ret1 = FALSE; - if (GetConsoleScreenBufferInfo(GetStdHandle(STD_OUTPUT_HANDLE), &csbi) && !IsDebuggerPresent()) { - return !csbi.dwCursorPosition.X && !csbi.dwCursorPosition.Y; + if (GetConsoleScreenBufferInfo(GetStdHandle(STD_OUTPUT_HANDLE), &csbi)) { + ret0 = !csbi.dwCursorPosition.X && !csbi.dwCursorPosition.Y; + } + + ret1 = GetConsoleProcessList(pl, 1) == 1; + + return ret0 && ret1; } return FALSE; |