feat: append socket path to resurrect_dir

BREAKING: will break existing sessions,
since session save location is changed.

Supposed migration path (to be tested):
while Tmux is running, remove previous version of resurrect
(remove from Tmux conf & TPM uninstall), then install this version,
then save your session.
This commit is contained in:
Anton 2023-07-07 11:25:04 +08:00
parent cff343cf9e
commit 4e1cdfa169

View File

@ -98,7 +98,7 @@ pane_content_files_restore_from_archive() {
resurrect_dir() { resurrect_dir() {
if [ -z "$_RESURRECT_DIR" ]; then if [ -z "$_RESURRECT_DIR" ]; then
local path="$(get_tmux_option "$resurrect_dir_option" "$default_resurrect_dir")" local path="$(get_tmux_option "$resurrect_dir_option" "$default_resurrect_dir")/$(basename $(tmux display-message -p -F "#{socket_path}"))"
# expands tilde, $HOME and $HOSTNAME if used in @resurrect-dir # expands tilde, $HOME and $HOSTNAME if used in @resurrect-dir
echo "$path" | sed "s,\$HOME,$HOME,g; s,\$HOSTNAME,$(hostname),g; s,\~,$HOME,g" echo "$path" | sed "s,\$HOME,$HOME,g; s,\$HOSTNAME,$(hostname),g; s,\~,$HOME,g"
else else