tmux-plugins / tmux-resurrect

Persists tmux environment across system restarts.
MIT License
11.4k stars 424 forks source link

Restoring non-existing directories #485

Open bart-jaskulski opened 1 year ago

bart-jaskulski commented 1 year ago

It would be nice if tmux-resurrect could restore session/window/pane path even if it not exists.

I heavily use /tmp directory in my daily work, serving as a scratchpad. I usually create such session with tmux new -c $(mktemp -d), landing in something like /tmp/tmp.cZXPfjfgzL, which is wiped out on device shutdown. While it isn't crucial to get back to the same directory after restoring sessions, currently the plugin leaves me at home dir.

I think there's a room for introducing optional feature of restoring directories (with a dedicated setting in tmux config). It would simply check if the directory exists and call mkdir -p $dir, possibly within restore_pane function, before actually creating any session/window/pane.