zellij-org / zellij

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

Fix package upgrade lost sessions #3420

Open jac-cbi opened 2 weeks ago

jac-cbi commented 2 weeks ago

Basic information

zellij --version: zellij 0.40.1

stty size: 66 104

uname -av or ver(Windows): Linux saturn 6.1.70 #4 SMP PREEMPT_DYNAMIC Tue Jan 2 17:33:33 UTC 2024 x86_64 Intel(R) Xeon(R) CPU E5-2650 0 @ 2.00GHz GenuineIntel GNU/Linux

Further information

Regular Gentoo updates migrated Zellij from 0.39.2 to 0.40.1.

When I ssh'd back in to the server, I expected ssh -t saturn zellij a session_name to re-attach to the existing session. The existing session was started under 0.39.2. No session was reported to exist, despite ps aux showing otherwise.

I found existing issue #3371 , with similar behavior. I attempted to follow the instructions listed as a temporary workaround. However, I was greeted with some form of empty message received error from the server. I've since reconstructed the session since I needed to keep working.

Other relevant information

I understand the client - server protocol, as well as the on-disk format, are subject to change. However, this is a huge PITA. Definitely kicks me out of flow state. :-(

Proposed solution

Could we add a zellij upgrade-session 0.39.2/session_name or similar to cleanly shut down the old session, migrate it, and spawn a new session with the new version of the server process? That would be a huge help.

Thanks!

jac-cbi commented 2 weeks ago

I presume a long-term solution would be to independently version the on-disk format, as well as the client-server protocol. I'm hoping that my suggested fix can be a part of that, because I would love for a way to cleanly upgrade the server binary of a running session while losing as little session state as possible