zellij-org / zellij

A terminal workspace with batteries included
https://zellij.dev
MIT License
21.3k stars 645 forks source link

Multisession state persistence bug? #963

Closed alekspickle closed 2 years ago

alekspickle commented 2 years ago

Basic information zellij --version: zellij 0.23.0 tput lines: 60 tput cols: 125 uname -av: Linux pickle 5.11.0-37-generic #41~20.04.2-Ubuntu SMP Fri Sep 24 09:06:38 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

cargo 1.56.0 (4ed5d137b 2021-10-04) rustc 1.56.1 (09c42c458 2021-10-18) git version 2.33.0 zsh 5.8 (x86_64-ubuntu-linux-gnu)

Further information I joined my session I used another terminal tab to connect with so I see how multisession is working. And it displayed as expected I guess: I saw whitespace with colored background on tab of another user. When I disconnected it was gone. But day later I reconnect to this session and see this colored whitespace but no users attached to it. When I attached and detached from other tab it was gone. Looks like some state persistence?

The only suspicious log I found in zellij.log is: WARN |zellij_server::panes::gri| 2021-12-22 12:51:51.896 [screen ] [/root/.cargo/registry/src/github.com-1ecc6299db9 ec823/zellij-server-0.23.0/src/panes/grid.rs:2053]: Unhandled csi: p->[12]

imsnif commented 2 years ago

So, just to make sure, you:

  1. Started a session
  2. Connected to it with another user
  3. The UI displayed the other user in the tab as expected
  4. Disconnected the other user
  5. The UI displayed no other users in the tab as expected
  6. Disconnected the first user
  7. Reconnected the first user and the UI indicated there are two users connected?
alekspickle commented 2 years ago

Yep

jovandeginste commented 2 years ago

I saw the same behaviour, didn't test the exact steps yet to reproduce. I'm sure I'm the single user of that session, though I see a panel title "My focus AND [ ]" (with some pinkish square).

This square seemed to move with me when I switched tabs, so maybe there is something wrong when switching tabs?

So to be clear: I never used the same session with two simultaneous users, but detach + re-attached.

jovandeginste commented 2 years ago

Steps to reproduce for me are:

Pane title is: ─┤ MY FOCUS AND: X ├── (where X is a magenta square)

image

After more testing: you should wait <5 seconds between every step to surely hit the bug. I'm sure I hit the bug in a different way (assuming it's the same bug), because it's not my hobby to attach/detach in rapid succession :wink:

imsnif commented 2 years ago

Right, I just issued a fix for this. If one of you wants to test out this musl binary to make sure, that'll be great (though no biggie, I'm pretty sure I got the issue). zellij-musl.tar.gz

jovandeginste commented 2 years ago

Quick test confirms this is fixed for me.

jovandeginste commented 2 years ago

Re-attaching this morning to my session from yesterday left me with a weird state: I can switch tabs, the other shortcuts seem to work, but the actual content doesn't change. I did not check what other changes were committed since the white-space issues got fixed, but maybe the fix for this issue here is causing this?

Eg. switching tabs changes the top bar, reflecting this change, but the actual panes (and pane content) remain the same.

I tried detaching en re-attaching, but this doesn't change anything.... If I detach on a different tab, and then re-attach, I'm back on the first tab.

jovandeginste commented 2 years ago

So, right after posting this comment, I did a wild thing: I created a new tab (in that "blocked" session). This actually created a new tab, focussed on it, and everything just worked again as it should. I also saw (at least some of) the other steps I did, reflected in the panes where I did them (blindly then).

imsnif commented 2 years ago

Oi man, I'm sorry to hear that! I am unfortunately not managing to recreate this. Are you working with the musl I attached here? Can you recreate this from scratch, or is it just dependent on something that happened in the long running session?

jovandeginste commented 2 years ago

Actually, no. This was on a different system where I'm still using the binary with the whitespace fixes. Not the one you added here. Sorry for the confusion.

Could it be that your changes here fix the issue I was now describing?

imsnif commented 2 years ago

Could it be that your changes here fix the issue I was now describing?

Definitely, yes. Though I can also imagine them causing this issue, if I'm being fair.

jovandeginste commented 2 years ago

Well, I'm sure I was not using the binary attached here:

$ md5sum ~/bin/zellij
d2d09928dd121871af4ba32c0297d70c  ~/bin/zellij

I will update this afternoon, but I will be off for a few weeks then, so don't expect too much feedback from me for a while... Also, happy New Year already, and I personally hope 2022 will not resemble 2021 too much (though I'm not holding my breath).

imsnif commented 2 years ago

Happy new year to you as well! I hope you have a good break, and thanks for all your help and feedback.

raphCode commented 2 years ago

I think this is fixed and can be closed?

alekspickle commented 2 years ago

I've stopped experiencing this circa 0.24v so I think so!