Monthly Archives: September 2014

Tmux true color (24-bit RGB) support.

Over the last year or so (2013+) there’s been a few terminal applications that have begun to support 24-bit or true color mode. The application I most wanted to take advantage of this was emacs where I use colorized themes (solarized, zenburn, etc). Eventually I found a diff and improved it some and posted about it here.

But normally I run emacs within tmux so I needed support within that as well. I found a mostly functional diff here; however, this didn’t support the newer “:” delimiter as well as needing some cosmetic changes to apply cleanly to the latest tmux (1.9a).

Here’s the result: tmux-1.9a diff

Happy Colorful Hacking.

Screenshot of emacs in tmux running in iTerm2 with 24-bit color.

Emacs true color (24-bit) in terminal support.

Over the last year or so (2013+) there’s been a few terminal applications that have begun to support 24-bit or true color mode. One terminal that supports true color is iTerm2 (the development version). The application I most wanted to take advantage of this was emacs where I use colorized themes (solarized, zenburn, etc). So I started googling around to find if this was supported and located a diff, unfortunately it did’t work. I started with this as a base and got things working.

Here’s the result:

In order to use this you must set one of two environment variables. For now the best option is to set KONSOLE_DBUS_SESSION=1 (I guess if you are using konsole this is already set for you). It uses the currently more implemented CSI sequence (supported by konsole, iterm, xterm, etc). To use the officially sanctioned way, you should set ITERM_24BIT=1. This latter mode uses colon’s instead of semi-colons in the CSI sequence which is more compatible with terminals that do not support the codes. This latter mode is defined in ITU T.416.

Happy Colorful Hacking.

Screenshot of emacs running over ssh in iTerm2 with full color pallet.