From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: =?UTF-8?Q?Rami_Ylim=C3=A4ki?= 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 14:43:54 +0200 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=94eb2c0caed6eeec500548e17f65 X-Trace: blaine.gmane.org 1487508247 17796 195.159.176.226 (19 Feb 2017 12:44:07 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 19 Feb 2017 12:44:07 +0000 (UTC) Cc: Emacs developers , Tino Calancha To: Kaushal Modi Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Feb 19 13:44:02 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 1cfQqM-0003t0-P3 for ged-emacs-devel@m.gmane.org; Sun, 19 Feb 2017 13:43:59 +0100 Original-Received: from localhost ([::1]:33416 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cfQqS-0001KG-Bv for ged-emacs-devel@m.gmane.org; Sun, 19 Feb 2017 07:44:04 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:52625) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cfQqM-0001K7-9Q for emacs-devel@gnu.org; Sun, 19 Feb 2017 07:43:59 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cfQqL-0002o0-4I for emacs-devel@gnu.org; Sun, 19 Feb 2017 07:43:58 -0500 Original-Received: from mail-qt0-x233.google.com ([2607:f8b0:400d:c0d::233]:36627) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cfQqK-0002nW-VI for emacs-devel@gnu.org; Sun, 19 Feb 2017 07:43:57 -0500 Original-Received: by mail-qt0-x233.google.com with SMTP id k15so69836974qtg.3 for ; Sun, 19 Feb 2017 04:43:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vincit.com; s=ticniv; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=77CMmly11NaIdYdO7tCiUulIQNS2VEaHvVrzL/x6V0g=; b=JNCVA23gQ9MqwXwEGlePXQMBKxbxEQ/mMtCEHGflBrI3Kxw7EAQ1jwYul1zi1v4m3a Vxgv9FSjs54ljNOi945lvQu6d/su5o3hKfvwVnus53n3P8v7Hl2yvzQ3qj0+2pNs/yn9 KQXqihaPstTumk3Vq7U6yZuE8yFQHbyZrp1uM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=77CMmly11NaIdYdO7tCiUulIQNS2VEaHvVrzL/x6V0g=; b=LQtRTooeGZWPCS7MyNHpPBkFJ0zolWM/F9tTMJI2AZ0ce5wPXsT2Wf7nxh68Xens+p jOBgMhdHg4GqTSgygt+3s4cNLxN5g0pxBZmw8RUqXaObFjKyyG88j/Q8mUaGGKH9fVFG XfGvuFkrJMJHKjGtXOcS8o75mDpzXDHtwi3Ieve+gckrdJZQcOXceUwGGjhThIg4V45f YB+9fYiokvseO0+SQqpN7Kjj/Nit0Cia2vtmdaKMLXGwUzDcSQPo8+FvtODKFfyynnK9 bNGKPYNbK3A8/W+Zbd0+25z5DECO+jD6eU59WxyRRnPr4pVPy+0iDgpXYFf9SUMcRdBj fVTw== X-Gm-Message-State: AMke39n0HL/hz5yDIhr7KqQSunctYz3Z1aQWvWVoS42o5XKQbZ4jdl5r/Eq/SnWQycx+sQhuiygbwcEdBG5Fj04z X-Received: by 10.237.33.67 with SMTP id 61mr15093942qtc.37.1487508234752; Sun, 19 Feb 2017 04:43:54 -0800 (PST) Original-Received: by 10.55.158.78 with HTTP; Sun, 19 Feb 2017 04:43:54 -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:400d:c0d::233 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:212465 Archived-At: --94eb2c0caed6eeec500548e17f65 Content-Type: text/plain; charset=UTF-8 2017-02-19 9:33 GMT+02:00 Kaushal Modi : I cannot set the 24-bit colors working on xterm directly. > 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=xterm-256color with Emacs is enough, because 24-bit colors are approximated anyway. 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: * Use a terminal that supports 24-bit colors (gnome-terminal). * 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=xterm-256color, Tc, setb24=\E[48;2;%p1%{65536}%/%d;%p1%{256}%/%{255}%&%d;%p1%{255}%&%dm, setf24=\E[38;2;%p1%{65536}%/%d;%p1%{256}%/%{255}%&%d;%p1%{255}%&%dm, * 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. --94eb2c0caed6eeec500548e17f65 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
2017= -02-19 9:33 GMT+02:00 Kaushal Modi <kaushal.modi@gmail.com>:

I cannot set the 24-bit colors working on= xterm directly.


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

<= div>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 pr= ovide from the direct xterm session or xterm+tmux session?

I haven't used tmux befor= e, but I was able to make Emacs work in direct color mode with following st= eps:

* Use a terminal that supports 24-bit colors = (gnome-terminal).

* Compile tmux from=C2=A0https://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 semic= olon separators for tmux):

$ cat terminfo-24b= it.src

# Use semicolon separators.
x= term-24bits|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 T= c,
=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,

=C2=A0* Compile the terminfo sou= rce, run tmux, set your TERM to xterm-24bits, check that Tc is supported:

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

* Finally run Emacs under t= mux.

--94eb2c0caed6eeec500548e17f65--