bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#45230: /bug#45231: [PATCH] Support underline colors and styles in te


From: Adam Schwalm
Subject: bug#45230: /bug#45231: [PATCH] Support underline colors and styles in terminal
Date: Thu, 22 Dec 2022 19:36:35 -0600

Many modern terminal emulators support control sequences that enable underlines
with colors other than the text foreground color and styles like the
'wave' used in GUI
mode Emacs. These two patches add support for using these control sequences
in terminal mode Emacs. The first enables support for terminals which
report support
for these features in their terminfo, the second adds two functions
which can be used
to override terminfo and explicitly enable the feature. The latter is
unfortunately probably
necessary, as there is no official way to announce support in terminfo
yet (though there
is an unofficial standard being followed by some terminals).

I have tested these patches on the following terminal emulators on GNU/Linux:

- Alacritty
- Kitty
- Wezterm
- gnome-terminal (vte)

And on Windows, I tested with mintty (though I have very little
experience with Windows
terminal emulators).

For alacritty, kitty and wezterm, the 'style' feature works without
any action from the user.
The 'Smulx' entry is present in their terminfo, which emacs detects.
Unfortunately, while
some terminals like wezterm do announce support for underline colors
via 'Setulc',
they do not announce support for the 'ol' feature used to reset the
underline color back
to default (which I think is necessary when turning off a face).
Therefore, I had to use
the new functions to force enable colors. After doing this, underline
colors worked in
the terminals listed above.

I will be working in the next few weeks to update the terminfo for
some of these terminal
emulators to reflect these capabilities, but this will presumably take
a long time to
actually land in the main ncurses terminfo.src. With that said, I do
think there is enough
of a general consensus on the terminfo names that should be used (from tmux and
existing usage in some terminals), that such additions will hopefully
be uncontroversial.

For the second patch, 'default' control sequences I've chosen (if the
user explicitly requests
underline color/styles be enabled on a terminal that does not declare
support for those
features) is supported by the terminals listed above as well as tmux.

Please note that I have not signed the copyright assignment, but if
these patches seem worth
merging in some form, I will complete that (and update
NEWS/manuals/etc). There are
some areas that I suspect I am doing things wrong as I don't have much prior
experience with emacs internals, so please let me know and I'll update things.

Thanks,
Adam Schwalm

Attachment: 0001-Support-underline-colors-and-styles-in-non-gui-mode.patch
Description: Text Data

Attachment: 0002-Allow-user-enabled-tty-underline-style-color.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]