Skip to content

Commit 38ae1b3

Browse files
committed
Setting the terminal colour to :default is special
It is worth taking note of the fact that the "default" colour in a terminal can be set with the -9 ANSI codes. Without this, dodgy control codes can be emitted when the current default face is changed, resulting in visual artifacts.
1 parent 2709150 commit 38ae1b3

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/io.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,8 @@ function termcolor(io::IO, color::SimpleColor, category::Char)
111111
else
112112
termcolor8bit(io, color.value, category)
113113
end
114+
elseif color.value === :default
115+
print(io, "\e[", category, "9m")
114116
elseif (fg = get(FACES.current[], color.value, getface()).foreground) != SimpleColor(color.value)
115117
termcolor(io, fg, category)
116118
else

0 commit comments

Comments
 (0)