You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Right click and swipe left or right in any pane to switch window in that
direction or swipe up or down to switch session.
As always any suggestions for improvements are welcome!
Purpose
When you are at the keyboard obviously a key sequence is both faster and more
natural to switch sessions or windows.
I use this tool mostly just getting a quick overview when having the
terminal on a side screen, in such cases mouse swiping is handy.
The reason I wrote it as a posix script is that since it gets run multiple
times in quick sequence, on my iPad running iSH, there is a noticeable
performance boost not having to repeatedly start bash scripts.
Once installed, try pressing down right button and swipe up, down, left
or right on any pane.
Once you release the button, tmux should switch window after horizontal
swipe and session after vertical.
If you only have one Window or Session, a message will be displayed
that the requested action can not be performed, depending on swipe direction.
Minimal movement
Since drag isn't registered until you move one character cell, and at least
one more cell of movement is needed to detect direction, minimal movement
distance is two characters.
Not purely vertical / horizontal swipes
If both vertical and horizontal swiping is detected, the axis with the most
delta is assumed to be the intended direction. Risk for miss-interpertaion
is reduced by making a slightly longer swipe.
Pane borders
tmux sends mouse coordinates relative to the pane that the mouse is over,
so if you cross a pane border during the swipe,
the direction of movement will most likely not be the intended.
Basic modifications
If you want to bind this to another mouse event, search for the
MOUSE SUPPORT section in the tmux man page for details on how to bind mouse
events. Change the binds towards the end of mouse_swipe.tmux in the top directory
of this repository.
Contributing
Contributions are welcome, and they are greatly appreciated!
Every little bit helps, and credit will always be given.