summaryrefslogtreecommitdiff
path: root/sapi/cli/php_cli.c
diff options
context:
space:
mode:
Diffstat (limited to 'sapi/cli/php_cli.c')
-rw-r--r--sapi/cli/php_cli.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/sapi/cli/php_cli.c b/sapi/cli/php_cli.c
index dc92045ae7..56ab3fec6d 100644
--- a/sapi/cli/php_cli.c
+++ b/sapi/cli/php_cli.c
@@ -38,6 +38,7 @@
#ifdef PHP_WIN32
#include "win32/time.h"
#include "win32/signal.h"
+#include "win32/console.h"
#include <process.h>
#include <shellapi.h>
#endif
@@ -243,6 +244,9 @@ static void print_extensions(void) /* {{{ */
#ifndef STDOUT_FILENO
#define STDOUT_FILENO 1
#endif
+#ifndef STDERR_FILENO
+#define STDERR_FILENO 2
+#endif
static inline int sapi_cli_select(int fd)
{
@@ -1208,6 +1212,11 @@ int main(int argc, char *argv[])
*/
argv = save_ps_args(argc, argv);
+#if defined(PHP_WIN32) && !defined(PHP_CLI_WIN32_NO_CONSOLE)
+ php_win32_console_fileno_set_vt100(STDOUT_FILENO, TRUE);
+ php_win32_console_fileno_set_vt100(STDERR_FILENO, TRUE);
+#endif
+
cli_sapi_module.additional_functions = additional_functions;
#if defined(PHP_WIN32) && defined(_DEBUG) && defined(PHP_WIN32_DEBUG_HEAP)