tmux-resurrect icon indicating copy to clipboard operation
tmux-resurrect copied to clipboard

Session working directory is being incorrectly restored

Open rinfiyks opened this issue 5 years ago • 2 comments

Steps to reproduce:

  1. Start a new session.
  2. cd into a different directory.
  3. If you open a new window in that session, the working directory for that window will be your home directory, not the directory you just changed to in the first window. This is expected tmux behaviour, because you never changed the session working directory.
  4. Using tmux-resurrect, save, kill, and restore tmux.
  5. The session working directory will now be the directory you changed into in step 2, even though you never changed it. So if you open a new window, the behaviour will now be different to what it was in step 3: its PWD will be the directory you changed to in step 2.

I always want my session working directory to by ~. Every time I restore tmux, for each session, it sets the session working directory to be the directory of the first window in that session, so I have to go around running :a -c ~ in each affected session to set it back to ~.

rinfiyks avatar Apr 20 '20 09:04 rinfiyks

PRs for this are welcome.

bruno- avatar Aug 16 '20 08:08 bruno-

I looked at writing up a PR for this (the basics seems simple - include #{session_path} in the dump), but it seems session information is not included unless "grouped"? This is likely some tmux feature I'm unaware of. Would the idea be to start including session info even for non-grouped sessions? How does one treat backwards compatibility with such format changes?

carlpett avatar Feb 18 '23 21:02 carlpett