Reset terminal colors before running compiled program

This commit is contained in:
def
2015-07-10 00:48:11 +02:00
parent 7d1a58224e
commit db5f8d6755
2 changed files with 6 additions and 0 deletions

View File

@@ -378,3 +378,4 @@ proc mainCommand* =
when SimulateCaasMemReset:
resetMemory()
resetAttributes()

View File

@@ -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)