From: Eli Zaretskii <eliz@gnu.org>
To: Dan Nicolaescu <dann@gnu.org>
Cc: eric.hanchrow@gmail.com, 22154@debbugs.gnu.org
Subject: bug#22154: 25.0.50; emacsclient -c "breaks" 256-color display in server
Date: Mon, 14 Dec 2015 17:56:43 +0200 [thread overview]
Message-ID: <83a8pd3txg.fsf@gnu.org> (raw)
In-Reply-To: <yxq37v5lfdl.fsf@fencepost.gnu.org> (message from Dan Nicolaescu on Mon, 14 Dec 2015 01:21:26 -0500)
> From: Dan Nicolaescu <dann@gnu.org>
> Cc: Eric Hanchrow <eric.hanchrow@gmail.com>, 22154@debbugs.gnu.org
> Gcc: nnml+archive:sent-mail-2015
> Date: Mon, 14 Dec 2015 01:21:26 -0500
>
> Using different number of colors on different ttys should work.
> I just tried it briefly, and it works fine on my Fedora machine with
> 24.5.
> I don't have a very recent version compiled.
>
> You can try it with
> $ emacs -Q -f server-start&
> Then from an xterm: emacsclient -t
> And then from a different one: env TERM=vt100 emacsclient -t
>
> The frame in the first xterm should display some colors, the one in the
> second should be b&w...
This simple use case indeed (almost) works. (To have it work better,
you need the patch I posted here.) But in general, the current
implementation doesn't support this, AFAICT, for 2 reasons:
. The default escape sequences sent to the terminal for turning
colors on and off are stored in a single global set of values (the
default_* variables in term.c). So every time set_tty_color_mode
is called, and the frame's parameters don't include the
tty-color-mode parameter (which is what happens usually) the
escape sequences get overwritten by the ones of the last tty we
initialized. It so happens that the display calls
set_tty_color_mode each time you switch to a different frame on a
TTY, so the risk of this happening is quite high, especially if
some frames do have the tty-color-mode parameter. The patch I
sent solves this part.
. The value of tty-defined-color-alist is global, so every call to a
terminal-specific FOO-register-default-colors will modify that
global value with its own colors, and those of the previous tty
will be lost. For example, the initialization of xterm-256 fills
tty-defined-color-alist with colors whose names are "color-0",
"color-1", etc., but if you later initialize an 8-color xterm,
these get nuked, and only the 8 or 16 standard colors remain
there.
The second part problem could only be fixed by making
tty-defined-color-alist a terminal-local variable.
Am I missing something?
next prev parent reply other threads:[~2015-12-14 15:56 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-12 21:49 bug#22154: 25.0.50; emacsclient -c "breaks" 256-color display in server Eric Hanchrow
2015-12-13 17:30 ` Eli Zaretskii
2015-12-13 18:05 ` Eric Hanchrow
2015-12-13 18:17 ` Eli Zaretskii
2015-12-13 18:37 ` Eli Zaretskii
2015-12-13 18:47 ` Eric Hanchrow
2015-12-13 19:51 ` Eli Zaretskii
2015-12-13 20:26 ` Eric Hanchrow
2015-12-13 20:49 ` Eli Zaretskii
2015-12-14 6:21 ` Dan Nicolaescu
2015-12-14 15:56 ` Eli Zaretskii [this message]
2015-12-14 16:39 ` Dan Nicolaescu
2015-12-14 17:02 ` Eli Zaretskii
2015-12-15 5:46 ` Dan Nicolaescu
2015-12-15 16:05 ` Eli Zaretskii
2015-12-15 16:37 ` Eric Hanchrow
2015-12-15 16:40 ` Eli Zaretskii
2015-12-18 4:59 ` Dan Nicolaescu
2020-09-05 14:50 ` Lars Ingebrigtsen
2020-09-05 15:31 ` Eli Zaretskii
2015-12-14 6:35 ` Dan Nicolaescu
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=83a8pd3txg.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=22154@debbugs.gnu.org \
--cc=dann@gnu.org \
--cc=eric.hanchrow@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).