tmux-plugins / tmux-resurrect

Persists tmux environment across system restarts.
MIT License
11.39k stars 423 forks source link

strange issue with a window at 7th index #363

Open ghost opened 4 years ago

ghost commented 4 years ago

If I have a window at index 7, and I restore, the 7th index is not restored (and disappears); Instead the 7th index's window name is placed in index 2 (the contents of index 2 is correct, just the name moves). Additionally, the window at index 0 also disappears

Here's a video of it in action: https://giant.gfycat.com/SlimAbsoluteBigmouthbass.webm

zsh 5.4.2 (x86_64-ubuntu-linux-gnu) oh-my-zsh: latest from github tmux 2.6 resurrect: latest using tpm (shift + U)

bruno- commented 4 years ago

I'm also getting some weird issues with misplaced windows lately.

Additionally, the window at index 0 also disappears

This one seems to be a bug related to this commit https://github.com/tmux-plugins/tmux-resurrect/commit/5f5f9d8fd5ff9769e5ef08d64a430ee7ab525dc7

avently commented 2 years ago

This one seems to be a bug related to this commit https://github.com/tmux-plugins/tmux-resurrect/commit/5f5f9d8fd5ff9769e5ef08d64a430ee7ab525dc7

Hello, @bruno- . About the commit you linked. I use byubu which uses tmux. In my case I have two sessions and every time I start tmux the plugin tmux-resurrect leaves one more session with name 1 (it's created by tmux automatically on start). I changed a file scripts/restore.sh and replaced session name 0 with 1. This fixed the problem with one unneeded blank session. Byobu has such behavior because it starts a new session automatically before everything else (but it's not visible via tmux ls). Here byobu starts it: https://github.com/dustinkirkland/byobu/blob/master/usr/share/byobu/profiles/tmux#L25 This line can be commented out and tmux ls starts with 0 afterwards. But it's not an option obviously.

Do you have thoughts on how this can be fixed? Maybe would be a good idea to make session name configurable at least for now. Say I have to hide session 1 while you have to hide 0, parameter set -g @resurrect-drop-sessions '0 1' can be introduced for end-users. It will also be useful for those who want to skip restoring specific sessions. Good idea?

P.S. for now I use:

set -g @resurrect-hook-post-restore-all 'tmux kill-session -t 1'

Works brilliant.

Also I have similar problem as in this issue. In my case I had a session with many windows open. Once I restored it I saw many sessions instead of one with one window per session. Windows from one session were placed into these new sessions (that I didn't create). Number of sessions were equal to number of windows in one session earlier. Don't know how to reproduce.