zellij-org / zellij

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

Sessions not found due to new Zellij version #3371

Open merikan opened 1 month ago

merikan commented 1 month ago

2. Issues with the Zellij UI / behavior / crash

$ zellij --version
zellij 0.40.1
$ alacritty --version
alacritty 0.13.2 (bb8ea18)
$ uname
Darwin
$ sw_vers
ProductName:        macOS
ProductVersion:     14.3.1
BuildVersion:       23D60

Issue description

I accidentally closed a terminal window with a session (named forms). I tried to attach to the session again but it did not work and I get the error "No session with the name 'forms' found!"

$ zellij a forms
No session with the name 'forms' found!

When I try to list sessions I get the message "No active zellij sessions found."

$ zellij list-sessions
No active zellij sessions found.

I then tried to start a new session with the name forms

$ zellij -s forms

but the resurrection didn't work (had the same problem with resurrection when going from 0.3x to 0.4x )

When I ps zellij I can see the sessions

$ ps aux | grep -i zellij
peter            11642   0,4  0,2 410557984 142944   ??  S    Mån08am  65:21.66 /opt/homebrew/bin/zellij --server /var/folders/fw/nhbvnpfx55sbksfzywrfdb_h0000gn/T/zellij-501/0.40.0/personal
peter             4049   0,1  0,3 410650880 199056   ??  S     2Maj24 138:38.61 /opt/homebrew/bin/zellij --server /var/folders/fw/nhbvnpfx55sbksfzywrfdb_h0000gn/T/zellij-501/0.40.0/forms
peter             3861   0,0  0,5 410347152 309472   ??  S     8:50am   0:05.10 /opt/homebrew/bin/zellij --server /var/folders/fw/nhbvnpfx55sbksfzywrfdb_h0000gn/T/zellij-501/0.40.1/forms

I can see the old sessions with version 0.40.0 and the newly created with version 0.40.1

I then downloaded version 0.40.0

~/Downloads
$ ./zellij --version
zellij 0.40.0

and killed the newly created session

$ zellij delete-session forms --force
A session by the name "forms" exists and is active, but will be force killed and deleted.
Session: "forms" successfully deleted.

and then list sessions with the version 0.40.0 binary

~/Downloads
$ ./zellij list-sessions
bootcamp [Created 5months 18days 9h 48m 20s ago] (EXITED - attach to resurrect)
temp [Created 1month 2days 9h 26m ago] (EXITED - attach to resurrect)
forms [Created 20days 23h 21m 4s ago]
personal [Created 3days 1h 7m 43s ago]

I can now attach to my session forms with the version 0.40.0 binary

$ ./zellij a forms

Other relevant information

I had similar problem with resurrection when going from 0.3x to 0.4x and I had to rename the resurrection folder (if I remember correctly)

Solution

Yes I just copied the old folder (previous version) to a new one with the new version.

iFreilicht commented 1 month ago

The sessions are stored in version-specific folders in the cache (~/.cache/zellij/ on Linux and ~/Library/Caches/org.Zellij-Contributors.Zellij on macOS). If you cd into those directories, you'll likely find a 0.40.0 directory. Just copy it to 0.40.1 and all your sessions should show up again.

merikan commented 1 month ago

@iFreilicht thanks. I did the same with resurrection a while back. Feels like a very strange and cumbersome way to upgrade an application 😉

amirkhaki commented 1 month ago

@merikan how did you solved the problem of resurrection? i currently have the problem and i don't know how to solve it i've removed the cache folder completely but no luck

merikan commented 1 month ago

@amirkhaki Yes I just copied the old folder (previous version) to a new one with the new version.

Dialga commented 1 month ago

A bit unusual to ignore old sessions with every new release isn't it?