make terminal.nim work with --app:gui

This commit is contained in:
Araq 2015-10-19 16:09:23 +02:00
commit 3ccd5ca64b

View file

@ -87,10 +87,12 @@ when defined(windows):
var hStdoutTemp = getStdHandle(STD_OUTPUT_HANDLE)
if duplicateHandle(getCurrentProcess(), hStdoutTemp, getCurrentProcess(),
addr(hStdout), 0, 1, DUPLICATE_SAME_ACCESS) == 0:
when defined(consoleapp):
raiseOSError(osLastError())
var hStderrTemp = getStdHandle(STD_ERROR_HANDLE)
if duplicateHandle(getCurrentProcess(), hStderrTemp, getCurrentProcess(),
addr(hStderr), 0, 1, DUPLICATE_SAME_ACCESS) == 0:
when defined(consoleapp):
raiseOSError(osLastError())
proc getCursorPos(h: Handle): tuple [x,y: int] =