Stephen Thirlwall <s...@dr.com> writes:

> Ideally, I'd like to be able to query the value of TVIM_PANE_ID from
> any pane in that particular window.

> Note that there may be a tvim pane in multiple windows, so this needs
> to be local to the window, not a global setting.

> Is there some way to do this using tmux functionality?

You can use the session environment to store the pane id in a per-window
variable, e.g. like this:

store_tvim_pane()
{
    CURWIN=$(tmux list-panes -F "#{window_index}" | head -1)
    tmux set-environment "TVIM_PANE_ID_${CURWIN}" $1
}

get_tvim_pane()
{
    CURWIN=$(tmux list-panes -F "#{window_index}" | head -1)
    tmux show-environment | grep "TVIM_PANE_ID_${CURWIN}"
}

Note: the window_index format requires tmux 1.6. In the upcoming tmux 1.7,
show-environment can even query a single variable at a time, avoiding the
use of grep.

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
tmux-users mailing list
tmux-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tmux-users

Reply via email to