unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Adam Schwalm <adamschwalm@gmail.com>
Cc: 45230@debbugs.gnu.org
Subject: bug#45230: /bug#45231: [PATCH] Support underline colors and styles in terminal
Date: Sat, 24 Dec 2022 09:47:52 +0200	[thread overview]
Message-ID: <83mt7d5jkn.fsf@gnu.org> (raw)
In-Reply-To: <CAA__5ZZ7W=60z8gb4D_pgyfw90nBA4bTCCsDOgU_YHn4QNo0+A@mail.gmail.com> (message from Adam Schwalm on Thu, 22 Dec 2022 19:36:35 -0600)

> From: Adam Schwalm <adamschwalm@gmail.com>
> 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).

I didn't see in the patches any code that would enable this feature in
the MS-Windows build of Emacs; did I miss something?

> 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.

If terminfo doesn't define these capabilities, how will we make sure
the terminal actually supports them?  Should we perhaps test the name
of the terminal?  I don't think I like just trusting the users on doing
TRT when they enable the feature by hand.

> 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, these are definitely features we'd like to have, so please do
start you legal paperwork rolling (I can send you the form if you
want/need that), so that we could accept the changes.





      reply	other threads:[~2022-12-24  7:47 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-13 22:29 bug#45230: 27.1; Fix support for wavy underlines on terminal mode Víctor Cuadrado Juan
2020-12-14 15:29 ` Eli Zaretskii
2022-12-23  1:36 ` bug#45230: /bug#45231: [PATCH] Support underline colors and styles in terminal Adam Schwalm
2022-12-24  7:47   ` Eli Zaretskii [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83mt7d5jkn.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=45230@debbugs.gnu.org \
    --cc=adamschwalm@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).