diff --git a/vm/os-windows-nt.c b/vm/os-windows-nt.c index 7ea8155072..afd1e0ed3b 100755 --- a/vm/os-windows-nt.c +++ b/vm/os-windows-nt.c @@ -91,4 +91,14 @@ void c_to_factor_toplevel(CELL quot) void open_console(void) { + if(!console_open) + { + if(!AttachConsole(ATTACH_PARENT_PROCESS)) + { + if(AllocConsole()) + console_open = true; + } + else + console_open = true; + } } diff --git a/vm/os-windows-nt.h b/vm/os-windows-nt.h index f74c7b1883..9e451f0301 100755 --- a/vm/os-windows-nt.h +++ b/vm/os-windows-nt.h @@ -18,4 +18,5 @@ typedef char F_SYMBOL; void c_to_factor_toplevel(CELL quot); long exception_handler(PEXCEPTION_POINTERS pe); +bool console_open; void open_console(void);