aboutsummaryrefslogtreecommitdiff
path: root/lib/std/debug.zig
diff options
context:
space:
mode:
authorLemonBoy <thatlemon@gmail.com>2021-05-15 09:59:22 +0200
committerAndrew Kelley <andrew@ziglang.org>2021-05-15 13:44:52 -0400
commit7a4b53fdee89f2d61cedbb3cef3bda24dacf2a57 (patch)
treee8bf09f0d0ef5196823eb9df5d2ac6882a0955ef /lib/std/debug.zig
parent36da8d02b56e06c92279b4df21fbfaa0273e6c7b (diff)
downloadzig-7a4b53fdee89f2d61cedbb3cef3bda24dacf2a57.tar.gz
zig-7a4b53fdee89f2d61cedbb3cef3bda24dacf2a57.zip
std: Avoid using white color when printing stacktraces
Use .bold instead of .white, the effect is the same for light-on-dark terminals but greatly improves the readability for dark-on-light ones. Closes #8761
Diffstat (limited to 'lib/std/debug.zig')
-rw-r--r--lib/std/debug.zig6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/std/debug.zig b/lib/std/debug.zig
index 6cca67f302..3c8423c388 100644
--- a/lib/std/debug.zig
+++ b/lib/std/debug.zig
@@ -306,6 +306,7 @@ const RED = "\x1b[31;1m";
const GREEN = "\x1b[32;1m";
const CYAN = "\x1b[36;1m";
const WHITE = "\x1b[37;1m";
+const BOLD = "\x1b[1m";
const DIM = "\x1b[2m";
const RESET = "\x1b[0m";
@@ -476,8 +477,9 @@ pub const TTY = struct {
.Red => out_stream.writeAll(RED) catch return,
.Green => out_stream.writeAll(GREEN) catch return,
.Cyan => out_stream.writeAll(CYAN) catch return,
- .White, .Bold => out_stream.writeAll(WHITE) catch return,
+ .White => out_stream.writeAll(WHITE) catch return,
.Dim => out_stream.writeAll(DIM) catch return,
+ .Bold => out_stream.writeAll(BOLD) catch return,
.Reset => out_stream.writeAll(RESET) catch return,
},
.windows_api => if (builtin.os.tag == .windows) {
@@ -629,7 +631,7 @@ fn printLineInfo(
comptime printLineFromFile: anytype,
) !void {
nosuspend {
- tty_config.setColor(out_stream, .White);
+ tty_config.setColor(out_stream, .Bold);
if (line_info) |*li| {
try out_stream.print("{s}:{d}:{d}", .{ li.file_name, li.line, li.column });