There is some information on 256-color support in the tmux FAQ.
Detecting the number of colors that the terminal supports is unfortunately not straightforward, for historical reasons. See Checking how many colors my terminal emulator supports for an explanation. This means that
- tmux cannot reliably determine whether the terminal supports more than 8 colors;
- tmux cannot reliably communicate to the application that it supports more than 8 colors.
When you're in tmux, the terminal you're interacting with is tmux. It doesn't support all of xterm's control sequences. In particular, it doesn't support the OSC 4 ; …
control sequence to query or set color values. You need to use that while directly running in xterm, outside tmux.
If you run tmux -2
, then tmux starts with 256-color support, even if it doesn't think that your terminal supports 256 colors (which is pretty common).
By default, tmux advertises itself as screen
without 256-color support. You can change the value of TERM
in .tmux.conf
to indicate 256-color support:
set -g default-terminal "screen-256color"
You can use TERM=xterm-256color
or TERM=screen-256color
on Ubuntu. These values will only cause trouble if you log in to a remote machine that doesn't have a termcap/terminfo entry for these names. You can copy the entries to your home directory on the remote machine; this works with most modern terminfo implementations.
# From the Ubuntu machine to a machine that doesn't have *-256color terminfo entries
ssh somewhere.example.com mkdir -p .terminfo/s .terminfo/x
scp -p /lib/terminfo/s/screen-256color somewhere.example.com:.terminfo/s/
scp -p /lib/terminfo/x/xterm-256color somewhere.example.com:.terminfo/x/
Best Answer
You can import the PDF file into a software like Inkscape and there you can do what you want, including a color check.