Skip to content

Commit

Permalink
Check for underline term capability flag
Browse files Browse the repository at this point in the history
A few terminals (Kitty) only set the Su cap not Smulx, we should
recognise either as sufficient for fancy underlines.
  • Loading branch information
tecosaur committed Jul 31, 2024
1 parent 987f776 commit 41b2446
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/io.jl
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,8 @@ function termstyle(io::IO, face::Face, lastface::Face=getface())
# Kitty fancy underlines, see <https://sw.kovidgoyal.net/kitty/underlines>
# Supported in Kitty, VTE, iTerm2, Alacritty, and Wezterm.
face.underline == lastface.underline ||
if haskey(Base.current_terminfo, :set_underline_style)
if haskey(Base.current_terminfo, :set_underline_style) ||
get(Base.current_terminfo, :can_style_underline, false)
if face.underline isa Tuple # Color and style
color, style = face.underline
print(io, "\e[4:",
Expand Down

0 comments on commit 41b2446

Please sign in to comment.