make terminal.nim work with --app:gui
This commit is contained in:
parent
03550f14f8
commit
3ccd5ca64b
1 changed files with 4 additions and 2 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue