From: Eli Zaretskii <eliz@gnu.org>
To: help-gnu-emacs@gnu.org
Subject: Re: Colors on TTY (v26)
Date: Sun, 31 Mar 2019 18:15:44 +0300 [thread overview]
Message-ID: <83v9zzgjmn.fsf@gnu.org> (raw)
In-Reply-To: <CAF8BazC+WjcbJUzdu-OPT7rjaWSzzDCZtmBHvzuCG3_3orkeRA@mail.gmail.com> (message from Aleksey Midenkov on Sun, 31 Mar 2019 11:22:59 +0300)
> From: Aleksey Midenkov <midenok@gmail.com>
> Date: Sun, 31 Mar 2019 11:22:59 +0300
>
> Trial and error shown that emacs holds special knowledge on terminal names:
> f.ex. "xterm-something" works as 256 colors and "xterm2" works as 16
> colors. This is in fact very strange because there are terminals like
> "screen.xterm-256color".
> So it's not good to hold special magic about term names for that. Why it
> doesn't check terminfo db for that (though it checks for 24bit as doc
> states)? Looks like a bug to me.
>
> To test it:
> 1. infocmp your current term into file;
> 2. rename file and rename term inside it;
> 3. tic renamed file;
> 4. set TERM to renamed term.
>
> And voila: it's either 256 or 16 colors depending on term name!
Emacs doesn't hard-code terminal names, but it has Lisp libraries
under lisp/term/ which are loaded by the terminal name. If you have a
terminal that behaves like one of the ones known to Emacs, you need
only copy the relevant Lisp library under lisp/term/ to the name of
your terminal (with the .el extension), and things should work from
there.
> Another bug:
> (list-color-display)
> always shows 16 colors from .emacs file (or from -f option). It detects 256
> colors somehow later and then list-colors-display executed interactively
> shows different result.
The full color list is indeed set during startup, so if you invoke
list-colors-display too early during startup, you will not see that.
This is not a bug, as Emacs can not know the color capabilities of the
terminal until it probes them.
next prev parent reply other threads:[~2019-03-31 15:15 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-03-31 8:22 Colors on TTY (v26) Aleksey Midenkov
2019-03-31 15:15 ` Eli Zaretskii [this message]
2019-03-31 17:20 ` Aleksey Midenkov
2019-03-31 17:41 ` Eli Zaretskii
2019-03-31 18:09 ` Aleksey Midenkov
2019-03-31 18:26 ` Eli Zaretskii
2019-03-31 19:45 ` Aleksey Midenkov
2019-03-31 20:51 ` Stefan Monnier
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=83v9zzgjmn.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=help-gnu-emacs@gnu.org \
/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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.