diff options
author | Andreas Rumpf <rumpf_a@web.de> | 2015-07-10 23:55:59 +0200 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2015-07-10 23:55:59 +0200 |
commit | 53b36178c75d6a6a2aa9d8d52898a82133d94c60 (patch) | |
tree | cfc25cd4b62146a039440327d8610c18d377c401 | |
parent | f915b71ec412a1c9b5a182a0fdf2a83781a52dee (diff) | |
parent | db5f8d6755031444143d514e424e4efa7e36da28 (diff) | |
download | Nim-53b36178c75d6a6a2aa9d8d52898a82133d94c60.tar.gz |
Merge pull request #3097 from def-/reset-terminal-colors
Reset terminal colors before running compiled program
-rw-r--r-- | compiler/main.nim | 1 | ||||
-rw-r--r-- | compiler/msgs.nim | 5 |
2 files changed, 6 insertions, 0 deletions
diff --git a/compiler/main.nim b/compiler/main.nim index ee4a34fbb..47fae7fa7 100644 --- a/compiler/main.nim +++ b/compiler/main.nim @@ -378,3 +378,4 @@ proc mainCommand* = when SimulateCaasMemReset: resetMemory() + resetAttributes() diff --git a/compiler/msgs.nim b/compiler/msgs.nim index f1d1029e4..e6bc45da6 100644 --- a/compiler/msgs.nim +++ b/compiler/msgs.nim @@ -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) |