#127 Don't discard colour8 in the 256 colour palette.

closed
nobody
None
2014-05-08
2014-05-08
Timothy Allen
No

tmux's internal representation of a terminal cell's colour depends on how it was set: if it was set using the traditional ECMA48 8/16 colour model, it's stored as (I think) the numeric parameter to the 'set foreground' or 'set background' escape sequence, whereas if it was set
via the xterm 256-colour model, it's stored as the actual palette index, and a flag is set saying 'this is a palette index'.

Unfortunately, under the old model, the number '8' is used to mean 'do not set a colour', while under the 256-colour model '8' means 'palette entry 8'. There's a whole bunch of code in tmux that wraps colour-setting logic in "if colour is not 8", without checking the
256-colour-model flag, which means if your tmux theme specifies anything as 'colour8', it'll probably not show up even though 'brightblack' (which should be equivalent) works fine.

The attached patch fixes all the instances of this problem that I've found.

1 Attachments

Discussion

  • Applied with the names of the flags fixed, thanks.

     
    • status: open --> closed