mirror of
https://github.com/nim-lang/Nim.git
synced 2026-01-03 19:52:36 +00:00
Reset terminal colors before running compiled program
This commit is contained in:
@@ -378,3 +378,4 @@ proc mainCommand* =
|
||||
when SimulateCaasMemReset:
|
||||
resetMemory()
|
||||
|
||||
resetAttributes()
|
||||
|
||||
@@ -865,6 +865,11 @@ proc rawMessage*(msg: TMsgKind, args: openArray[string]) =
|
||||
proc rawMessage*(msg: TMsgKind, arg: string) =
|
||||
rawMessage(msg, [arg])
|
||||
|
||||
proc resetAttributes* =
|
||||
if optUseColors in gGlobalOptions:
|
||||
terminal.resetAttributes()
|
||||
stdout.flushFile()
|
||||
|
||||
proc writeSurroundingSrc(info: TLineInfo) =
|
||||
const indent = " "
|
||||
msgWriteln(indent & $info.sourceLine)
|
||||
|
||||
Reference in New Issue
Block a user