From: "Daniel Martín via Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: 48755@debbugs.gnu.org
Subject: bug#48755: 28.0.50; Emacs doesn't detect the terminal background color in macOS Terminal or iTerm2
Date: Mon, 31 May 2021 00:20:35 +0200 [thread overview]
Message-ID: <m1eednkgng.fsf@yahoo.es> (raw)
In-Reply-To: m1eednkgng.fsf.ref@yahoo.es
Steps to reproduce the problem:
- Start macOS Terminal or iTerm2 (both are probably the most popular
terminals for macOS).
- Switch the terminal background color to a dark color.
- emacs -nw -Q
Actual result:
Colored text is sometimes very difficult to read, because Emacs assumes
it's running on a light terminal background, and configures the faces
accordingly.
Expected result:
Emacs faces are those of a dark background.
Workaround:
Customize frame-background-mode to 'dark.
Here's some information about macOS Terminal and iTerm2. Apparently,
they both identify as xterm-256color and support querying the background
color:
macOS Terminal:
$ printf '\e[>0c'
1;95;0c
$ printf '\e]11;?\e\'
11;rgb:0000/0000/0000
$ echo $TERM
xterm-256color
iTerm2:
$ printf '\e[>0c'
0;95;0c
$ printf '\e]11;?\e\'
11;rgb:0000/0000/0000
$ echo $TERM
xterm-256color
I tried to fix the problem by taking a look at xterm--version-handler in
xterm.el, but the version logic is a bit difficult to understand. Is
there some documentation about the versions and capabilities somewhere?
I'm worried about changing things there may cause regressions in other
terminals.
Thanks.
next parent reply other threads:[~2021-05-30 22:20 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <m1eednkgng.fsf.ref@yahoo.es>
2021-05-30 22:20 ` Daniel Martín via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2021-05-31 12:02 ` bug#48755: 28.0.50; Emacs doesn't detect the terminal background color in macOS Terminal or iTerm2 Eli Zaretskii
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=m1eednkgng.fsf@yahoo.es \
--to=bug-gnu-emacs@gnu.org \
--cc=48755@debbugs.gnu.org \
--cc=mardani29@yahoo.es \
/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).