diff --git a/src/conio/win32cio.c b/src/conio/win32cio.c
index d8a800a8ab767d6e129c263e39192195bdf56b13..e393f14d3e9f4836210df53cc322573ef94fb611 100644
--- a/src/conio/win32cio.c
+++ b/src/conio/win32cio.c
@@ -375,8 +375,10 @@ int win32_initciolib(long inmode)
 	int	i,j;
 	CONSOLE_SCREEN_BUFFER_INFO	sbuff;
 
-	if(!isatty(fileno(stdin)))
-		return(0);
+	if(!isatty(fileno(stdin))) {
+		if(!AllocConsole())
+			return(0);
+	}
 
 	if(!GetConsoleMode(GetStdHandle(STD_INPUT_HANDLE), &conmode))
 		return(0);