From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Kaushal Modi Newsgroups: gmane.emacs.devel Subject: Re: Black and white emacs -nw (WAS: Re: [PATCH v3 0/4] Support 24-bit terminal colors.) Date: Sun, 19 Feb 2017 15:21:31 +0000 Message-ID: References: <1487087902-6661-1-git-send-email-rami.ylimaki@vincit.fi> <8360k7rc39.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a1144fe184972470548e3b4dc X-Trace: blaine.gmane.org 1487517744 18149 195.159.176.226 (19 Feb 2017 15:22:24 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 19 Feb 2017 15:22:24 +0000 (UTC) Cc: Emacs developers , Tino Calancha To: =?UTF-8?Q?Rami_Ylim=C3=A4ki?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Feb 19 16:22:18 2017 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cfTJY-0003r5-Rg for ged-emacs-devel@m.gmane.org; Sun, 19 Feb 2017 16:22:17 +0100 Original-Received: from localhost ([::1]:34076 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cfTJc-0005Qj-Oy for ged-emacs-devel@m.gmane.org; Sun, 19 Feb 2017 10:22:20 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:44589) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cfTJ3-0005Qc-Jd for emacs-devel@gnu.org; Sun, 19 Feb 2017 10:21:48 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cfTJ2-0002SW-30 for emacs-devel@gnu.org; Sun, 19 Feb 2017 10:21:45 -0500 Original-Received: from mail-vk0-x231.google.com ([2607:f8b0:400c:c05::231]:33459) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cfTJ1-0002SB-SI for emacs-devel@gnu.org; Sun, 19 Feb 2017 10:21:43 -0500 Original-Received: by mail-vk0-x231.google.com with SMTP id k127so50703687vke.0 for ; Sun, 19 Feb 2017 07:21:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=j87NCVCcMv9yw1WqatqzBFPOqF6LZkr8FOc3MtAa9q0=; b=GRAFUrpZ5/0R7J+StiOopds4brRRnLyvyD0zpsbG4dY1NY9zTzF7MJnWRyww7YXo57 EGuQ4e1VjvkacCVVmYCeJQND6bB0d0MkM5ZnT2XsLd9OIP16fCrv5JVQPSennQKOGRB6 UbgZsiovtBi+9YyvUC3L1w25mYabep3JWAWpy/WrKaS/MvytXGbL+Y2ML1/S6iHvB6Od GdsAK2zBYY/uea7Ujp/9BJFeBetADhKkVuA9h1JSOfOOjYZ73qdGCmN54k+pNumUH57h vLvsGns4RJOvTk0WLSsuAzkEQZpYp3HUUBd+uTpbqFn9PYyuVVi7TaI7riBNw5JsnXKn qJqw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=j87NCVCcMv9yw1WqatqzBFPOqF6LZkr8FOc3MtAa9q0=; b=N+7HWSBUvwrTKFp27dFlhE5+DNM6BkeSDo2PMorrb11KK7W6YQmnf0O3kRrSSyT/ol qKO1QUYZPngX9hnxBsN8/aY2U7oETHu8Fqc7ENk2emOCxtgb2gdrN2ftLxsbIc99uFKO j0rQoY7yJGZP0+4gW0agAy8adRp0VoXROLWTQNKNYRQydlmsQOQP7SDAgoPrbeAHBXm4 XtNaQotlJc+iajq0ZtvhKjRlfkIPCqTO6xLa7Tj6u+NwMScSEQv7oarfAcs+UPqhDKRY BCY31eJ+IzS1FeaibAuN27EizpuktRkxgOxbZMUe7gGpbAzswKCVALtalhRecuomoaVI gubg== X-Gm-Message-State: AMke39lVSKLmChxjmJRiA6XjNg37CPtXCf7/Tp5khxmWHUtUyT29gy/X6KCLM9Y9MIc7H0nU1i0EW0s7lMqLdA== X-Received: by 10.31.11.78 with SMTP id 75mr8646150vkl.94.1487517703039; Sun, 19 Feb 2017 07:21:43 -0800 (PST) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2607:f8b0:400c:c05::231 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:212468 Archived-At: --001a1144fe184972470548e3b4dc Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Sun, Feb 19, 2017 at 7:43 AM Rami Ylim=C3=A4ki wrote: > > XTerm supports the direct color mode escape sequences, but approximates > colors. See > https://gist.github.com/XVilka/8346728#parsing-ansi-colour-sequences-but-= approximating-them-to-256-palette > and https://gist.github.com/XVilka/8346728#now-supporting-truecolour for > details. > > Note that if you want to use XTerm, then using TERM=3Dxterm-256color with > Emacs is enough, because 24-bit colors are approximated anyway. > Thanks for that explanation; it helps understand why the colors don't exactly look as in 24-bit mode. But that is much better than 256 colors! :) > I did not do a full bootstrap. But it still seems to work in uxterm in > tmux configured for 24-bits. > But it doesn't work directly in an xterm terminal. > > What debug information can I provide from the direct xterm session or > xterm+tmux session? > > > I haven't used tmux before, but I was able to make Emacs work in direct > color mode with following steps: > Wow! I cannot thank you enough! I really appreciate the effort you went through to help me get this working. > * Use a terminal that supports 24-bit colors (gnome-terminal). > Thanks. I will try that. But for now, with your fixed terminfo with Tc, it works great in xterm too. > * Compile tmux from https://github.com/tmux/tmux.git. The version > provided with Ubuntu doesn't support Tc-flag. > > * Use following terminfo source (add the Tc-flag and use semicolon > separators for tmux): > > $ cat terminfo-24bit.src > > # Use semicolon separators. > xterm-24bits|xterm with 24-bit direct color mode, > use=3Dxterm-256color, > Tc, > > setb24=3D\E[48;2;%p1%{65536}%/%d;%p1%{256}%/%{255}%&%d;%p1%{255}%&%dm, > > setf24=3D\E[38;2;%p1%{65536}%/%d;%p1%{256}%/%{255}%&%d;%p1%{255}%&%dm, > Thank you! This fixed the color anomaly I reported in my last email. > * Compile the terminfo source, run tmux, set your TERM to xterm-24bits, > check that Tc is supported: > > $ tmux info | grep Tc > 199: Tc: (flag) true > > * Finally run Emacs under tmux. > Thanks again! :) --=20 Kaushal Modi --001a1144fe184972470548e3b4dc Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable

On Sun, Fe= b 19, 2017 at 7:43 AM Rami Ylim=C3=A4ki <rami.ylimaki@vincit.com> wrote:

<= div dir=3D"ltr" class=3D"gmail_msg">
XTerm supports = the direct color mode escape sequences, but approximates colors. See=C2=A0<= a href=3D"https://gist.github.com/XVilka/8346728#parsing-ansi-colour-sequen= ces-but-approximating-them-to-256-palette" class=3D"gmail_msg" target=3D"_b= lank">https://gist.github.com/XVilka/8346728#parsing-ansi-colour-sequences-= but-approximating-them-to-256-palette and https://gist.github.com/XVilka/8346728#now-supporting-truecolou= r for details.

Note that if you want to use XTerm, then using= TERM=3Dxterm-256color with Emacs is enough, because 24-bit colors are appr= oximated anyway.

Th= anks for that explanation; it helps understand why the colors don't exa= ctly look as in 24-bit mode. But that is much better than 256 colors! :)
=C2=A0
<= div dir=3D"ltr" class=3D"gmail_msg">
I = did not do a full bootstrap. But it still seems to work in uxterm in tmux c= onfigured for 24-bits.
But it doesn't wor= k directly in an xterm terminal.

What debug information can I pro= vide from the direct xterm session or xterm+tmux session?
=

<= /div>
I haven't used tmux before, but I was able to make Emacs work = in direct color mode with following steps:

Wow! I cannot thank you enough! I really appreciate= the effort you went through to help me get this working.
=C2=A0<= /div>
* Use a terminal that supports 24-bit colors (gnome-t= erminal).

Thanks. I= will try that. But for now, with your fixed terminfo with Tc, it works gre= at in xterm too.
=C2=A0
* Compile tmux from= =C2=A0https://github.com/tmux/tmux.git. The version provided wi= th Ubuntu doesn't support Tc-flag.
=

=C2=A0
* Use following terminfo s= ource (add the Tc-flag and use semicolon separators for tmux):

$ cat terminfo-24bit.src

# Use semicolon separators.
xterm-24bi= ts|xterm with 24-bit direct color mode,
=C2= =A0 =C2=A0 =C2=A0 =C2=A0 use=3Dxterm-256color,
=C2=A0 =C2=A0 =C2=A0 =C2=A0 Tc,
=C2=A0 =C2= =A0 =C2=A0 =C2=A0 setb24=3D\E[48;2;%p1%{65536}%/%d;%p1%{256}%/%{255}%&%= d;%p1%{255}%&%dm,
=C2=A0 =C2=A0 =C2=A0 = =C2=A0 setf24=3D\E[38;2;%p1%{65536}%/%d;%p1%{256}%/%{255}%&%d;%p1%{255}= %&%dm,

Th= ank you! This fixed the color anomaly I reported in my last email.
=C2=A0
=C2=A0* Compile the terminfo source, run tmu= x, set your TERM to xterm-24bits, check that Tc is supported:

$ tmux info | grep Tc
=C2=A0199: Tc: (flag) true

* Finally= run Emacs under tmux.

<= div>Thanks again! :)=C2=A0
--
<= div data-smartmail=3D"gmail_signature">

Kaushal Modi

--001a1144fe184972470548e3b4dc--