mirror of
https://github.com/powerline/powerline.git
synced 2025-07-23 05:46:01 +02:00
Added support for truecolor in tmux status line
This commit is contained in:
parent
a4a1c83539
commit
b53708b577
@ -163,6 +163,9 @@ def init_tmux_environment(pl, args, set_tmux_environment=set_tmux_environment):
|
||||
(attr for attr in attrs if not attr.startswith('no')))
|
||||
# But it does not support empty attributes as well.
|
||||
or 'none'))
|
||||
else:
|
||||
if powerline.common_config['term_truecolor'] is True:
|
||||
set_tmux_environment(varname, '#{0:06x}'.format(get_highlighting(group)[attr][1]))
|
||||
else:
|
||||
set_tmux_environment(varname, 'colour' + str(get_highlighting(group)[attr][0]))
|
||||
|
||||
|
@ -47,11 +47,17 @@ class TmuxRenderer(Renderer):
|
||||
if fg is not None:
|
||||
if fg is False or fg[0] is False:
|
||||
tmux_attrs += ['fg=default']
|
||||
else:
|
||||
if self.term_truecolor and fg[1]:
|
||||
tmux_attrs += ['fg=#{0:06x}'.format(int(fg[1]))]
|
||||
else:
|
||||
tmux_attrs += ['fg=colour' + str(fg[0])]
|
||||
if bg is not None:
|
||||
if bg is False or bg[0] is False:
|
||||
tmux_attrs += ['bg=default']
|
||||
else:
|
||||
if self.term_truecolor and bg[1]:
|
||||
tmux_attrs += ['bg=#{0:06x}'.format(int(bg[1]))]
|
||||
else:
|
||||
tmux_attrs += ['bg=colour' + str(bg[0])]
|
||||
if attrs is not None:
|
||||
|
Loading…
x
Reference in New Issue
Block a user