tmuxline.vim icon indicating copy to clipboard operation
tmuxline.vim copied to clipboard

Is it possible to set the color using an ascii escape, rather than 8bit xterm code?

Open nfarrar opened this issue 10 years ago • 8 comments

Some terminals (for examples iTerm2) support more than 8-bit colors ... and the color scheme I'm currently using in my terminal makes use of full RGB colors. Is there a way to set the colors using the ansi escapes rather than RGB values so that they'll be displayed using my terminal emulator's color theme?

nfarrar avatar Dec 16 '14 02:12 nfarrar

I don't think tmux understands true color (8bit) unless you patch it.

Anyway, you could do this: create a tmuxline.conf file with :TmuxlineSnapshot, then eidt tmuxline.conf (modify the colors as needed) and then source it with tmux source tmuxline.conf.

Please let me know if you manage to achieve this - I may add it to the core of the plugin (although first vim will have to be able to use true color without any patches)

edkolev avatar Dec 18 '14 10:12 edkolev

Still playing around with this. Tmux correctly displays 24-bit rgb color (assuming your terminal emulator does), and I've got tmuxline configured to use my custom color mappings (0..15), still trying to figure out how to calculate and override the the xterm extended color palette with consistent truecolors calculated from the base.

nfarrar avatar Jan 19 '15 20:01 nfarrar

Since https://github.com/tmux/tmux/commit/427b8204268af5548d09b830e101c59daa095df9 tmux has true color, any plan to support it?

AlessioRocco avatar Feb 14 '16 22:02 AlessioRocco

Here's how solarized in vim-airline and tmuxline not match when I activate true color in tmux

screen shot 2017-02-06 at 1 59 06 pm

rawaludin avatar Feb 06 '17 06:02 rawaludin

This discussion will help one to activate true color in tmux https://github.com/tmux/tmux/issues/34

I use this one https://github.com/tmux/tmux/issues/34#issuecomment-241527745

rawaludin avatar Feb 06 '17 07:02 rawaludin

Here's how to check true color in terminal https://gist.github.com/XVilka/8346728

rawaludin avatar Feb 06 '17 07:02 rawaludin

I use this solarized theme https://github.com/frankier/neovim-colors-solarized-truecolor-only

rawaludin avatar Feb 06 '17 07:02 rawaludin

For example, I see generated tmux theme are using ctermfg from theme. If I use guifg value, I successfully get true color.

Here example for OceanicNext theme: https://github.com/mhartington/oceanic-next/blob/master/colors/OceanicNext.vim

Generated theme: https://gist.github.com/rawaludin/e2fd38c29ddc32507a76a7178be350c1

What it should be: https://gist.github.com/rawaludin/ab862046bdc6ac1bc5ed62d9ba13f54f

I use this setup:

let g:tmuxline_preset = {
      \'a'               : '#{?client_prefix,#[reverse][P]#[noreverse] ,}#{?window_zoomed_flag,#[reverse][F]#[noreverse] ,}#S',
      \'win'             : ['#I', '#W'],
      \'cwin'            : ['#I', '#W'],
      \'x'               : '#(focus)',
      \'y'               : ['%a, %b %d'],
      \'z'               : '%R #(bat)',
      \'options'         : {
        \'status-justify'  : 'left'}
      \}
" simple
let g:tmuxline_separators = {
    \ 'left' : '',
    \ 'left_alt': '|',
    \ 'right' : '',
    \ 'right_alt' : '|',
    \ 'space' : ' '}

Oh, and set -g status-utf8 "on" is deprecated.

rawaludin avatar Feb 06 '17 07:02 rawaludin