gnu: screen: support 256 colors

Message ID cu7twfuhcu1.fsf_-_@gmail.com
State New
Headers

Commit Message

myglc2 July 12, 2016, 7:32 p.m. UTC
  ludo@gnu.org (Ludovic Courtès) writes:

> myglc2 <myglc2@gmail.com> skribis:
>
>> I almost always run emacs in a gnu screen session.
>>
>> For iterm-256color, in guixSD I have observed that ...
>>
>> 'screen; emacs -nw' ... supports 16 colors.
>>
>> 'tmux; emacs -nw' ... supports 8.
>
> An indication that GNU Screen is superior!  ;-)
>
> Seriously though, I think that’s because tmux does not provide a
> terminfo file.  See <http://linsam.homelinux.com/tmux/terminfo.html>.
>
> Does “export TERM=screen” or “TERM=xterm” helps?
>
> Ludo’.

Actually, we have been building screen with 16 color support. With the
attached patch and the addition of ...

term xterm-256color

... to ~/.screenrc, emacs 'M-x list-colors-display' shows 256 colors and
emacs-zenburn-theme is pleasant to look at :-)

If emacs handled the "screen.xterm-256color" term type emitted by screen
when --enable-colors256 is set, then the 'term xterm-256color' would not
be required. This should be fixed upstream, but meanwhile, 'term
xterm-256color' is a fully functional workaround AFAIKT.
  

Comments

Ludovic Courtès July 13, 2016, 10:41 a.m. UTC | #1
myglc2 <myglc2@gmail.com> skribis:

> Actually, we have been building screen with 16 color support. With the
> attached patch and the addition of ...
>
> term xterm-256color
>
> ... to ~/.screenrc, emacs 'M-x list-colors-display' shows 256 colors and
> emacs-zenburn-theme is pleasant to look at :-)
>
> If emacs handled the "screen.xterm-256color" term type emitted by screen
> when --enable-colors256 is set, then the 'term xterm-256color' would not
> be required. This should be fixed upstream, but meanwhile, 'term
> xterm-256color' is a fully functional workaround AFAIKT.

Good catch!

> From 1b05f484b6c4eb1827e1aa0e8b69f53f1db6bf80 Mon Sep 17 00:00:00 2001
> From: George Clemmer <myglc2@gmail.com>
> Date: Tue, 12 Jul 2016 13:57:28 -0400
> Subject: [PATCH] * gnu: screen: support 256 colors
>
> ---
>  gnu/packages/screen.scm | 12 ++++++++----
>  1 file changed, 8 insertions(+), 4 deletions(-)

Applied with a commit log.

Thanks!

Ludo’.
  

Patch

From 1b05f484b6c4eb1827e1aa0e8b69f53f1db6bf80 Mon Sep 17 00:00:00 2001
From: George Clemmer <myglc2@gmail.com>
Date: Tue, 12 Jul 2016 13:57:28 -0400
Subject: [PATCH] * gnu: screen: support 256 colors

---
 gnu/packages/screen.scm | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/gnu/packages/screen.scm b/gnu/packages/screen.scm
index a4eefd8..adee72d 100644
--- a/gnu/packages/screen.scm
+++ b/gnu/packages/screen.scm
@@ -49,11 +49,15 @@ 
        ("perl" ,perl)))
     (arguments
      `(#:configure-flags
-       ;; By default, man and info pages are put in PREFIX/{man,info},
-       ;; but we want them in PREFIX/share/{man,info}.
        (let ((out (assoc-ref %outputs "out")))
-         (list (string-append "--mandir=" out "/share/man")
-               (string-append "--infodir=" out "/share/info")))))
+         (list
+          ;; By default, man and info pages are put in PREFIX/{man,info},
+          ;; but we want them in PREFIX/share/{man,info}.
+          (string-append "--mandir=" out "/share/man")
+          (string-append "--infodir=" out "/share/info")
+          ;; By default, screen supports 16 colors, but we want 256 when
+          ;; ~/.screenrc contains 'term xterm-256color'
+          (string-append "--enable-colors256")))))
     (home-page "http://www.gnu.org/software/screen/")
     (synopsis "Full-screen window manager providing multiple terminals")
     (description
-- 
2.9.0