changing pane styles and formats conditionally

19 views
Skip to first unread message

Sivaram Neelakantan

unread,
May 28, 2020, 12:23:01 PM5/28/20
to tmux-...@googlegroups.com
I tried to changing pane styles and formats like this and I can't seem
to get the pane border style to change colour if inactive

--8<---------------cut here---------------start------------->8---
# setting pane titles and colours conditionally
%if "#{pane_active}"
set -g pane-active-border-style bg=red,fg=black
set -g pane-border-style fg=black
set-option -g pane-border-format "#stuff here"
%else
set -g pane-active-border-style bg=blue,fg=black
set -g pane-border-style fg=black
set-option -g pane-border-format "#stuff here"
%endif
--8<---------------cut here---------------end--------------->8---

what am I doing wrong?

sivaram
--

Nicholas Marriott

unread,
May 28, 2020, 12:44:04 PM5/28/20
to Sivaram Neelakantan, tmux-users
%if only works when the file is parsed. You cannot do this easily unless you build tmux from master - then you can use formats directly in pane-border-style.

Although there isn't much point in doing that for pane_active since that's what pane-active-border-style already does.



--
You received this message because you are subscribed to the Google Groups "tmux-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tmux-users+...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/tmux-users/krpqx3blm83u77.fsf%40gmail.com.

Sivaram Neelakantan

unread,
May 28, 2020, 11:16:07 PM5/28/20
to tmux-...@googlegroups.com
On Thu, May 28 2020,Nicholas Marriott wrote:

> %if only works when the file is parsed. You cannot do this easily
> unless you build tmux from master - then you can use formats
> directly in pane-border-style.
>
> Although there isn't much point in doing that for pane_active since
> that's what pane-active-border-style already does.
>

Thanks for clarifying. Is there any way to grey out the pane titles
for non-active panes? The use case is simply that the active pane
needs to be bright including pane titles while the remaining panes
needs to have more subdued colours in the title or grayed out.


[snipped 27 lines]



sivaram
--

Nicholas Marriott

unread,
May 29, 2020, 1:23:07 AM5/29/20
to Sivaram Neelakantan, tmux-...@googlegroups.com
If you only want to change the pane status line then you can use
embedded styles in pane-border-format, look at
https://github.com/tmux/tmux/wiki/Getting-Started#embedded-styles
> --
> You received this message because you are subscribed to the Google Groups "tmux-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to tmux-users+...@googlegroups.com.
> To view this discussion on the web, visit https://groups.google.com/d/msgid/tmux-users/krpqx34krz2zyn.fsf%40gmail.com.
Reply all
Reply to author
Forward
0 new messages