From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#45230: /bug#45231: [PATCH] Support underline colors and styles in terminal Date: Sat, 24 Dec 2022 09:47:52 +0200 Message-ID: <83mt7d5jkn.fsf@gnu.org> References: <4d1d7ff3dae9d2cb04dce6ad15e93a3a20eb55b8.camel@viccuad.me> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="1964"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 45230@debbugs.gnu.org To: Adam Schwalm Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Dec 24 08:49:14 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1p8zHO-0000JO-9y for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 24 Dec 2022 08:49:14 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p8zHF-00006r-00; Sat, 24 Dec 2022 02:49:05 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p8zHC-00006R-PO for bug-gnu-emacs@gnu.org; Sat, 24 Dec 2022 02:49:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1p8zHC-0002gT-H3 for bug-gnu-emacs@gnu.org; Sat, 24 Dec 2022 02:49:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1p8zHC-0002u9-6k for bug-gnu-emacs@gnu.org; Sat, 24 Dec 2022 02:49:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 24 Dec 2022 07:49:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 45230 X-GNU-PR-Package: emacs Original-Received: via spool by 45230-submit@debbugs.gnu.org id=B45230.167186808311087 (code B ref 45230); Sat, 24 Dec 2022 07:49:02 +0000 Original-Received: (at 45230) by debbugs.gnu.org; 24 Dec 2022 07:48:03 +0000 Original-Received: from localhost ([127.0.0.1]:41506 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p8zGE-0002sk-EB for submit@debbugs.gnu.org; Sat, 24 Dec 2022 02:48:02 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:48052) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p8zGC-0002rr-KI for 45230@debbugs.gnu.org; Sat, 24 Dec 2022 02:48:01 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p8zG7-0000bE-7C; Sat, 24 Dec 2022 02:47:55 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=elPa41zbD8plGU2AuXN3C/Ih68p/eJLXGlAPqVMne3I=; b=K700eX65kjAx y4R79rbRstNj58gJ4ulRXCymR55yq8RlM7hkceOX82GSivGJzw+qe/IIVcXUHoM0Ud866Ag+L2p10 xnrL1+dwJ9nzgBEqSvOnIFRxWMpU1DLBy5bldXmNFxI6luj10VjsKvauRDm+r8Ac5uObK+AGbFTE8 XbpT9oWXGVkvlNuE1y7bgdSMWNsRG2MeKJkyK6GnXjtqhImUBg3D2woyLFHWhBN2BrTx50xOtBfbA mN99eNRZMJcyaTj++2QBXC5Q040YTufJ5WfGvnBUE91DNXPJnVWBKy+XSuo/BqqOq7EUrgDFgCETN i5F9MgWTTbBE864dLhlf3w==; Original-Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p8zG6-0003Ng-EI; Sat, 24 Dec 2022 02:47:54 -0500 In-Reply-To: (message from Adam Schwalm on Thu, 22 Dec 2022 19:36:35 -0600) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:251772 Archived-At: > From: Adam Schwalm > 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.