Merge pull request #3097 from def-/reset-terminal-colors

Reset terminal colors before running compiled program
This commit is contained in:
Andreas Rumpf
2015-07-10 23:55:59 +02:00
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)