DISQUS

Enigma Curry: 256 colors on the Linux terminal

  • JosefA · 11 months ago
    The bad news is, this doesn't work under GNU screen...
  • ryan · 11 months ago
    @JosefA,

    Screen sets TERM=screen which reverts back to 8 colors. However, resetting TERM=xterm-256color makes the colors work again inside of screen. You could probably automate this behavior by setting an alias to emacs that sets that variable beforehand.

    There is also something interesting going on with Multi-TTY emacs. When I connect to an already running emacs session with emacsclient (from within screen) it doesn't matter if TERM=screen. I still see all the colors.

    This is kind of a non-issue for me; I really love screen, and I have used it a lot in the past, but I have been using it less and less now that Multi-TTY emacs merged into the mainline Emacs. I run everything inside of emacs now (ansi-terms for programs outside of emacs) and when I ssh into my box I just connect to my long running emacs session.
  • piyo · 11 months ago
    I also wrestled with this combination, although for me it was GNU screen, Emacs 22.1, and putty on Windows.

    First set the term to xterm-256color inside of Putty (Connection > Data >> Terminal Type String). Then, in GNU screen's config file .screenrc, set the term explicitly using "term xterm-256color" (more on "term screen-256color" later). Then, run emacs. If there's a problem with the colors, define a term/xterm-256color.el file some where in your elisp path with the contents of [1].

    I recently tried "term screen-256color" but while the colors became 256 in number, the functions keys such as F3 and F4 did not input correctly. I am sticking with "term xterm-256color" for now.

    [1] http://www.xvx.ca/~awg/emacs-colors-howto.txt
  • kmt · 11 months ago
    Does *shell* work for you? I'm getting the control characters.
  • tim · 5 months ago
    i also get issues with the shell
  • ryan · 11 months ago
    @kmt

    I see some strangeness in shell mode, but to be honest, that's the first time I've typed M-x shell in probably 5 years, so I'm probably not the best person to judge.
  • JosefA · 11 months ago
    Ryan, that works, even in PuTTY. Brill. :)
  • Peter Harkins · 11 months ago
    I blogged about this a little while ago and included info on how to get it working in screen. Hope it helps.
  • joydivision · 11 months ago
    very cool.
  • Jadu Saikia · 11 months ago
    Nice info. I have a post to list the color combination
    http://unstableme.blogspot.com/2007/12/colors-in-...
  • Brandon_Thomson · 11 months ago
    Thanks, I set this up just now on my linux box. To start the new 256 color terminal I just put a button that launches xterm in my menu bar/gnome panel. Looks great with vim inkpot scheme.