Question about usage of targe-pane "special tokens"

18 views
Skip to first unread message

Carles Ràfols

unread,
Jun 3, 2020, 1:33:17 PM6/3/20
to tmux-users
Hello,

I am a new tmux user and I am having a lot of trouble understanding the behaviour of the target-pane "special tokens" after reading the following extract from the manual:
     target-pane (or src-pane or dst-pane) may be a pane ID or takes a similar form to target-window but with the
     optional addition of a period followed by a pane index or pane ID, for example: ‘mysession:mywindow.1’.  If the
     pane index is omitted, the currently active pane in the specified window is used.  The following special tokens
     are available for the pane index:

     Token                  Meaning
     {last}            !    The last (previously active) pane
     {next}            +    The next pane by number
     {previous}        -    The previous pane by number
     {top}                  The top pane
     {bottom}               The bottom pane
     {left}                 The leftmost pane
     {right}                The rightmost pane
     {top-left}             The top-left pane
     {top-right}            The top-right pane
     {bottom-left}          The bottom-left pane
     {bottom-right}         The bottom-right pane
     {up-of}                The pane above the active pane
     {down-of}              The pane below the active pane
     {left-of}              The pane to the left of the active pane
     {right-of}             The pane to the right of the active pane

It is unclear to me what is the proper syntax to use these tokens. I ran the simplest test I could think of to figure out how it works:
  1. After creating a horizontal split with split-window -h now the right pane is the active pane.
  2. If I wanted to make the left pane the active pane I could (AFAIK) do that by running any of the following commands:
    • select-pane -L (works)
    • select-pane -t - (works)
    • select-pane -t {left} (works)
    • select-pane -t {previous} (doesn't work)
    • select-pane -t {left-of} (doesn't work)
Why some of these syntax works and some don't? if the "-" token works, shouldn't "{previous}" work as well? I would appreciate if you could clarify how to properly use these tokens.

Thank you in advance.

Nicholas Marriott

unread,
Jun 3, 2020, 3:25:28 PM6/3/20
to Carles Ràfols, tmux-users
They all work for me. You may need to put '{left-of}' in single quotes
if you are using them from the command prompt.
> --
> 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/d3d1e045-4aac-4b64-8e10-f3b3da53dd92%40googlegroups.com.

Carles Ràfols

unread,
Jun 3, 2020, 3:42:13 PM6/3/20
to tmux-users
Thank you for the quick reply. It was a quotation problem indeed. It is strange that some tokens worked without them though, for instance {right} worked but {next} didn't. It is worth mentioning that I had to use quotes in both the .tmux.conf file and in the command prompt for the commands that didn't work to function correctly.
> To unsubscribe from this group and stop receiving emails from it, send an email to tmux-...@googlegroups.com.

Nicholas Marriott

unread,
Jun 3, 2020, 3:48:16 PM6/3/20
to Carles Ràfols, tmux-users
The old form of "{left}" was just "left" and it still works. {} is
special quoting syntax, so {left} becomes just left - which is still
valid. But {next} becomes just next which is not valid.


On Wed, Jun 03, 2020 at 12:42:12PM -0700, Carles Ràfols wrote:
> Thank you for the quick reply. It was a quotation problem indeed. It is
> strange that some tokens worked without them though, for instance {right}
> worked but {next} didn't. It is worth mentioning that I had to use quotes
> in both the .tmux.conf file and in the command prompt for the commands
> that didn't work to function correctly.
>
> On Wednesday, 3 June 2020 20:25:28 UTC+1, Nicholas Marriott wrote:
>
> They all work for me. You may need to put '{left-of}' in single quotes
> if you are using them from the command prompt.
>
> On Wed, 3 Jun 2020 at 18:33, Carles RA fols <kar...@gmail.com> wrote:
> >
> > Hello,
> >
> > I am a new tmux user and I am having a lot of trouble understanding
> the behaviour of the target-pane "special tokens" after reading the
> following extract from the manual:
> > A A A target-pane (or src-pane or dst-pane) may be a pane ID or
> takes a similar form to target-window but with the
> > A A A optional addition of a period followed by a pane index or pane
> ID, for example: a**mysession:mywindow.1a**. A If the
> > A A A pane index is omitted, the currently active pane in the
> specified window is used. A The following special tokens
> > A A A are available for the pane index:
> >
> > A A A Token A A A A A A A A A Meaning
> > A A A {last} A A A A A A ! A A The last (previously active)
> pane
> > A A A {next} A A A A A A + A A The next pane by number
> > A A A {previous} A A A A - A A The previous pane by number
> > A A A {top} A A A A A A A A A The top pane
> > A A A {bottom} A A A A A A A The bottom pane
> > A A A {left} A A A A A A A A The leftmost pane
> > A A A {right} A A A A A A A A The rightmost pane
> > A A A {top-left} A A A A A A The top-left pane
> > A A A {top-right} A A A A A A The top-right pane
> > A A A {bottom-left} A A A A A The bottom-left pane
> > A A A {bottom-right} A A A A The bottom-right pane
> > A A A {up-of} A A A A A A A A The pane above the active pane
> > A A A {down-of} A A A A A A A The pane below the active pane
> > A A A {left-of} A A A A A A A The pane to the left of the
> active pane
> > A A A {right-of} A A A A A A The pane to the right of the
> email to tmux-users+...@googlegroups.com.
> To view this discussion on the web, visit
> https://groups.google.com/d/msgid/tmux-users/543da01a-6256-4b07-aaa3-d3fe02fbfe59%40googlegroups.com.

Reply all
Reply to author
Forward
0 new messages