mirror of
https://github.com/nim-lang/Nim.git
synced 2026-02-13 06:43:52 +00:00
make terminal.nim work with --app:gui
This commit is contained in:
@@ -87,11 +87,13 @@ when defined(windows):
|
||||
var hStdoutTemp = getStdHandle(STD_OUTPUT_HANDLE)
|
||||
if duplicateHandle(getCurrentProcess(), hStdoutTemp, getCurrentProcess(),
|
||||
addr(hStdout), 0, 1, DUPLICATE_SAME_ACCESS) == 0:
|
||||
raiseOSError(osLastError())
|
||||
when defined(consoleapp):
|
||||
raiseOSError(osLastError())
|
||||
var hStderrTemp = getStdHandle(STD_ERROR_HANDLE)
|
||||
if duplicateHandle(getCurrentProcess(), hStderrTemp, getCurrentProcess(),
|
||||
addr(hStderr), 0, 1, DUPLICATE_SAME_ACCESS) == 0:
|
||||
raiseOSError(osLastError())
|
||||
when defined(consoleapp):
|
||||
raiseOSError(osLastError())
|
||||
|
||||
proc getCursorPos(h: Handle): tuple [x,y: int] =
|
||||
var c: CONSOLESCREENBUFFERINFO
|
||||
|
||||
Reference in New Issue
Block a user