The marked pane is server wide.

If your tmux is new enough (built from master or 3.2-rc) you could set a
user option on the pane you started with and then check it in status-style,
for example:

set -p @firstpane 1
set -g status-style 'bg=#{?@firstpane,red,blue}'

Or just check its name, something like (not tested):

set -g status-style
'bg=#{?#{&&:#{==:#{window_name},netkit-vm},#{==:#{pane_index},0}},red,blue}'


On Tue, 5 Jan 2021 at 19:35, Billy Bromell <[email protected]> wrote:

>
> Hi
>
> I'm trying to set up tmux so that the when the active pane is the pane
> that the session started with, the status bar is a different colour to that
> of when it is in a pane that has been created later. Here is what I have so
> far:
>
> set-hook -g session-created 'select-pane -m; rename-window netkit-vm; set
> -t 0 remain-on-exit on'
> set-hook -g pane-focus-in 'if -F "#{==:#{pane_marked},1}" "set
> status-style bg=#c78add" "set status-style bg=blue"'
>
> The second hook works - whenever i move to a marked pane the status bar
> turns purple, and whenever i move to an unmarked pane it turns blue.
>
> However when I'm using multiple sessions, it seems that only one of them
> has a marked pane. I wasn't sure if "set -g" was the right option but the
> rename-window part of the hook seems to work as all sessions have the first
> window named correctly.
>
> Is a pane mark global to a tmux server (running all sessions under `tmux
> -L netkit` ) ? I thought they were session specific rather than server
> specific?
>
> As the pane that i want the purple active status bar for, should always
> have window_name 'netkit-vm', pane_index 0 - this might be useful for the
> pane-focus hook but i couldnt work out an if statement that worked.
>
> Any help would be appreciated!!
>
> Billy
>
> --
> 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 [email protected].
> To view this discussion on the web, visit
> https://groups.google.com/d/msgid/tmux-users/8379d701-2df8-4163-ab8d-12d89eb25d40n%40googlegroups.com
> <https://groups.google.com/d/msgid/tmux-users/8379d701-2df8-4163-ab8d-12d89eb25d40n%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
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 [email protected].
To view this discussion on the web, visit 
https://groups.google.com/d/msgid/tmux-users/CAEdLfcHv9V_vB74wS%3DYdqRufifaHJ03-fQF7OeMbNConFr%2BMdg%40mail.gmail.com.

Reply via email to