Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pane Wraparound #817

Open
guy-who-googles opened this issue Oct 29, 2021 · 5 comments
Open

Pane Wraparound #817

guy-who-googles opened this issue Oct 29, 2021 · 5 comments
Labels
action Issues related to actions help wanted Extra attention is needed suspected bug

Comments

@guy-who-googles
Copy link

guy-who-googles commented Oct 29, 2021

In Case of Graphical or Performance Issues

Nothing interesting in the log file.

Basic information

zellij --version: 0.19
tput lines: 50
tput cols: 103
uname -av: Linux usah 5.11.0-38-generic #42~20.04.1-Ubuntu SMP Tue Sep 28 20:41:07 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

List of programs you interact with as, PROGRAM --version: output cropped meaningful, for example:
gnome-terminal --version: GNOME Terminal 3.36.2 using VTE 0.60.3 +BIDI +GNUTLS +ICU +SYSTEMD

Further information
When using the default config file, I setup two tabs with horizontal splits:

  1. Alt+N for a new pane
  2. Ctrl+t,n, Enter for a new tab
  3. Alt+N for a new pane

Then, the following behavior seems non-deterministic:

  1. navigate to pane 1 on tab 1
  2. use Alt+L Alt+H to navigate between panes.

Result:

  • When moving from pane 1 tab 1 to tab 2 using Alt+H, sometimes you land on pane 1 instead of pane 2.
  • When moving from pane 2 tab 2 to tab 1 using Alt+L, sometimes you land on pane 2 instead of pane 1.

After testing it a few times, it seems this happens once every 5 to 10 times you navigate between tabs.

@a-kenji
Copy link
Contributor

a-kenji commented Oct 31, 2021

Hey!
Thank you for taking the time in creating this issue.
Are you sure this is non-deterministic?
I can't really reproduce it.

I always end up on the pane I left the tab.
So for example:

 *Tab 1 - *Pane 1 - Pane 2
  Tab 2 - *Pane 1

If I am in this state, Tab 1 selected Pane 1 selected and toggle to Tab 2, I am in this situation:

   Tab 1 - *Pane 1 - Pane 2
 * Tab 2 - *Pane 1

And if I now toggle back to tab 1, the pane 1 will be selected again.

   Tab 1 - *Pane 1 - Pane 2
 * Tab 2 - *Pane 1

If I select Pane 2 the behavior is analogous.

@guy-who-googles
Copy link
Author

guy-who-googles commented Nov 2, 2021

Hello!
My bad, words are hard. Maybe this will clarify.

Wrap Backwards

Beginning State:

Tab 1: *Pane 1, Pane 2
Tab 2: Pane 1, Pane 2

where * denotes the current pane selected

So pressing Alt+h to go left I would expect to always land on,

Expected State:

Tab 1: Pane 1, Pane 2
Tab 2: Pane 1, *Pane 2

However, sometimes I land on,

Unexpected State:

Tab 1: Pane 1, Pane 2
Tab 2: *Pane 1, Pane 2

Wrap Forwards

The same occurs with pressing Alt+l when on the last pane.

Beginning State:

Tab 1: Pane 1, Pane 2
Tab 2: Pane 1, *Pane 2

Expected State:

  • Frequency: Most of the time
Tab 1: *Pane 1, Pane 2
Tab 2: Pane 1, Pane 2

Unexpected State:

  • Frequency: Some of the time
Tab 1: Pane 1, *Pane 2
Tab 2: Pane 1, Pane 2

Does that make sense?

@a-kenji
Copy link
Contributor

a-kenji commented Nov 9, 2021

@guy-who-googles,

When wrapping around you go to the last pane you were on on that tab,
so for example:

Beginning State

Tab 1: Pane 1, Pane 2
Tab 2: Pane 1, *Pane 2

This is not enough information to know where you land on,
you need to take into account the last position you were on the tab
you want to switch to. For example:

Beginning State:

Tab 1: Pane 1, Pane 2
Tab 2: Pane 1, *Pane 2

If you were before on Tab1 Pane 1 you would switch to Pane 1,
if you were before on Tab1 Pane 2 you would switch to Pane 2.

@guy-who-googles
Copy link
Author

Oh shoot, you're right! Hmm, I can see why that's desirable behavior.

What I find confusing is that I move based on order (1st pane to 2nd pane) within the tab, but move based on recency between tabs (if on pane 2 of 2nd tab last, moving right from pane 2 tab 2 land me there instead of pane 1).

I just tried using the actions FocusNextPane and FocusPreviousPane instead of the MoveFocusOrTab: Right and MoveFocusOrTab: Left and got the same behavior moving across panes between tabs.

It would be clearer (at least to me), if recency and order were separate, as with cycling through browser tabs.

  • FocusNextPane/FocusPreviousPane
    • move based on recency alone
  • MoveFocusOrTab
    • move based on order/index alone

I never used tmux though, so perhaps this is expected.

@a-kenji
Copy link
Contributor

a-kenji commented Nov 9, 2021

@guy-who-googles
No, problem. I was just trying to confirm everything.

If this is a confusing behavior I don't think it is unreasonable to want to change it.

I never used tmux though, so perhaps this is expected.

Tmux is awesome, but we don't need to have all the behavior the same.

It would be clearer (at least to me), if recency and order were separate, as with cycling through browser tabs.

I can see how that could be. If anyone wants to implement that I would be open in trying it out and see if that feels better.

@a-kenji a-kenji added help wanted Extra attention is needed action Issues related to actions labels Nov 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
action Issues related to actions help wanted Extra attention is needed suspected bug
Projects
None yet
Development

No branches or pull requests

2 participants