From db5f8d6755031444143d514e424e4efa7e36da28 Mon Sep 17 00:00:00 2001 From: def Date: Fri, 10 Jul 2015 00:48:11 +0200 Subject: Reset terminal colors before running compiled program --- compiler/main.nim | 1 + compiler/msgs.nim | 5 +++++ 2 files changed, 6 insertions(+) (limited to 'compiler') 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) -- cgit 1.4.1-2-gfad0