Hi,
Sorry for not replying earlier. The solution Johaness suggested works
perfect for me. I didn't know
about the #{pane_top} #{pane_left} modifiers which allow me to list the
panes based on their location in a window.
Binded with zsh I'm able to tell each pane to execute a function based on
its location.
Nocholas, I think that with the #{pane_top} #{pane_left}, the use case I
had for the relative '-t' isn't relevant.
I can't think of another use case which would make this function useful.
Thank you both for your help :),
Shay
On Mon, May 10, 2021 at 10:03 AM Nicholas Marriott <
[email protected]> wrote:
> There is no way to say "left of pane X" without making X the active pane,
> you would need to use select-pane before left-of/right-of.
>
> It would probably not be too hard to implement this but I am not sure if
> the best way would be by modifying display-pane or adding a format modifier
> (so you do eg #{p/left-of:%1} or something). I think the latter would be
> better.
>
> It may be possible just to offer the pane's position in the window as
> format variable, but I'm not sure how that would work with more than four
> panes. If you have 8 panes do you try to do something like "top-left+1"?
> "top+1-left+1"?
>
>
> On Fri, 7 May 2021 at 17:10, Shay Agros <[email protected]> wrote:
>
>> Hi,
>> This functionality feels to me like it can be possible but I can't seem
>> to find it.
>> I want to get the panes id of all panes in a window *by their geometrical
>> location*. Meaning that I need to know what is the index of the upper-left
>> pane, the index of the pane to its right etc.
>>
>> Ideally, I could describe a window's panes and have their geometric
>> location and dimension inside a window (for each pane know its x, y and
>> height, width) so that I could match between their location and their ids,
>> but I couldn't find such information.
>>
>> I also tried using something like the following:
>> first=$(tmux display-message -p -t {top-left} '#{pane_id}')
>> second=$(tmux display-message -p -t ${first} -t {right-of}
>> '#{pane_id}')
>> third=$(tmux display-message -p -t ${first} -t {down-of}
>> '#{pane_id}')
>> fourth=$(tmux display-message -p -t ${third} -t {right-of}
>> '#{pane_id}')
>>
>> but I don't seem to be able to concatenate the '-t' parameters so that it
>> would work relatively to the one before it.
>> I guess I would be able to make it work if I actually change the focus
>> and call `display-message` each time, but this would create an annoying
>> jitter on the screen (this should happen fast, and I don't really need the
>> focus to change).
>>
>> Also I don't want to rely on having only 4 panes (in which case I could
>> use {top-left}, {bottom-left} and similar), and I don't want to rely on
>> creating the panes in a specific order (which would give them subsequent
>> ids) but rather to only depend on the pane's geometrical location when
>> invoking my command.
>>
>> Does the functionality I'm looking for exists ? Alternatively, is it
>> difficult to implement ? (I'm guessing tmux does hold the dimensions and
>> location of each pane inside a window).
>>
>> thanks,
>> Shay
>>
>> --
>> 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/00a1ca80-2929-4558-8f37-64aa7bfb6650n%40googlegroups.com
>> <https://groups.google.com/d/msgid/tmux-users/00a1ca80-2929-4558-8f37-64aa7bfb6650n%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/CAGm33UcP5%2BXCJGiSAuQx%2Bub7aaodTYAZWtkiNPwZwnqMxxvJBw%40mail.gmail.com.