zellij
zellij copied to clipboard
[BUG] calling the root session after attaching another one from it makes zellij collapse on itself
Unfortunately zellij --debug didn't create any logs for me at the specified location (i.e in the tmp dir).
Basic information
zellij --version: 0.36.0
stty size: 88 133
uname -av or ver(Windows): Darwin MacBook-Pro.local 21.1.0 Darwin Kernel Version 21.1.0: Wed Oct 13 17:33:23 PDT 2021; root:xnu-8019.41.5~1/RELEASE_X86_64 x86_64
List of programs you interact with as, PROGRAM --version: Irrelevant
Further information Reproduction steps:
- Open two separate sessions A and B.
- Attach session B from session A
zellij attach B - Attach session A from the newly attached session B
zellij attach A
Demo video: https://github.com/zellij-org/zellij/assets/1759539/f863002b-e965-43a7-b3ac-c01e9e782741
Session A and B, Although they are two different sessions, under the hood, they still share the same session metadata, including screen thread.
Also, zellij does not support attach the current session. By doing step 3, it sounds like it tries to attach current session indirectly? the render went wrong at step 3.
Interesting bug, but need some further investigations
@Kangaxx-0 can you suggest any action items on this?
@Kangaxx-0 can you suggest any action items on this?
I want to take this back - ~~Session A and B, Although they are two different sessions, under the hood, they still share the same session metadata, including screen thread.~~, This is completely misleading, because you probably had two zellij processes, so A and B are separated, and run by different sockets.
I will run some investigation and hopefully could fix it or give some suggestions
I think I know what's going on to this issue, whenever we attach a session, the first thing zellij server does is to resize the terminal. But when you have two sessions, and try attaching with each other, zellij will loop below steps:
- The server calculates the new Size of the terminal.
- It then proceeds to resize the terminal based on this calculation.
- The updated tty size triggers a SIGWINCH signal as the size has changed.
- Zellij has a dedicated thread to listen for SIGWINCH signals. Upon capturing this signal, Zellij initiates a resize instruction, which loops back to step 1.
This is the reason why the pane has shrunk line by line, while you were not able to send any input.
In which user scenarios you need to inter-attach two different sessions? To fix this issue, it is going to be BIG change