I am attempting to get ANSI to display properly in a screen session using Iterm2 on OS X, the default TERM is set to


I tried

export TERM=vt100 


export TERM=ansi

enter image description here

enter image description here


export TERM=xterm 
w/ tmux

enter image description here

  • I also use BitchX with similar issue on special characters only my setup is TERM=xterm & using tmux instead of screen :)
    – francois P
    Feb 13, 2018 at 19:42
  • ya, I just tried xterm, same thing though, maybe im setting it wrong? Feb 13, 2018 at 19:43
  • Is this question about bitchx colors or is it about terminal colors? The two are totally different. I write a tool that does this kind of thing, and IRC clients use different color syntax than terminals do. You also can only safely use a subset of the colors to be cross platform consistent, but it's unclear from your question what you are actually trying to do. Your first image clearly is being sent color syntax that the machine doesn't understand, or the application, or the terminal. I use only I think 12 colors that are known fairly safe re background/foreground color combos.
    – Lizardx
    Feb 14, 2018 at 3:15
  • On the bright side, your purplish image is quite nice, and would make a fine work of computer type art. I doubt it can be improved much aesthetically on that side of things.
    – Lizardx
    Feb 14, 2018 at 3:22

2 Answers 2


setting TERM=ansi will not work well because tmux is only designed to handle the escape sequences which are found in the screen terminal description.

If you do infocmp ansi screen, you may notice these lines, showing terminal capabilities which terminal applications will use, that differ between the two terminal descriptions, but tmux and/or iTerm2 mishandle when misled in this manner:

        ech: '\E[%p1%dX', NULL.
        rep: '%p1%c\E[%p2%{1}%-%db', NULL.
        rin: '\E[%p1%dT', NULL.
        rmpch: '\E[10m', NULL. 
        rmacs: '\E[10m', '^O'.
        smacs: '\E[11m', '^N'.
        smpch: '\E[11m', NULL.

Since tmux is confused, there is no guarantee what might show up on the display.

The same applies to TERM=xterm. The tmux manual documents this limitation.

Setting TERM=vt100 is close (use infocmp to see), but most people know that vt100's never did ANSI color.


The issue isn't the terminal emulation - leave the TERM setting as is.

It's that the character set used by those part of the UI is CP437, but your terminal is set to another character set (probably UTF8).

You can either set iTerm2 to use CP437 if it supports that (the setting is under Terminal / Character Encoding), or you can use the cp437 utility to emulate a CP437 terminal on a UTF-8 terminal.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .