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

~/.tmux/resurrect/restore/pane_contents//pane-${NAME}:10.0: No such file or directory

Open mdeguzis opened this issue 3 years ago • 2 comments

See #141 ...

I am still getting this error:

cat: /home/deguzim/.tmux/resurrect/restore/pane_contents//pane-work:10.0: No such file or directory

The tar archive is being written regularly via https://github.com/tmux-plugins/tmux-continuum and if I do ctrl+s+s manually:

$ ls -la ~/.tmux/resurrect  
total 344
drwxr-xr-x 4 deguzim amazon 307200 Aug  9 13:38 .
drwxr-x--- 4 deguzim amazon   4096 Mar  9  2021 ..
lrwxrwxrwx 1 deguzim amazon     34 Aug  9 13:38 last -> tmux_resurrect_20220809T133839.txt
-rw-r--r-- 1 deguzim amazon  19909 Aug  9 13:38 pane_contents.tar.gz
drwxr-xr-x 3 deguzim amazon   4096 Mar 12  2021 restore
drwxr-xr-x 3 deguzim amazon   4096 Mar 12  2021 save
-rw-r--r-- 1 deguzim amazon   8137 Aug  9 13:38 tmux_resurrect_20220809T133839.txt

The archive is present and contents are there:

$ tar -tvf ~/.tmux/resurrect/pane_contents.tar.gz | head
drwxr-xr-x deguzim/amazon    0 2022-08-09 13:41 ./pane_contents/
-rw-r--r-- deguzim/amazon  893 2022-08-09 13:41 ./pane_contents/pane-work:2.6
-rw-r--r-- deguzim/amazon 1762 2022-08-09 13:41 ./pane_contents/pane-work:7.0
-rw-r--r-- deguzim/amazon 5615 2022-08-09 13:41 ./pane_contents/pane-work:4.2
-rw-r--r-- deguzim/amazon  851 2022-08-09 13:41 ./pane_contents/pane-work:10.0
[...]

$ tail /tmp/tmux-temp/pane_contents/pane-work:10.0
 13                     "limit"=> 2                       
 14                 },       
 15                 {        
 16                     "lower"=> 200,                    
 17                     "upper"=> 299,                    
 18                     "limit"=> 40                      
 19                 },       
 20                 {        
 21                     "lower"=> 300,        

Save directory is blank:

s -la ~/.tmux/resurrect/save/pane_contents
total 8
drwxr-xr-x 2 deguzim amazon 4096 Aug  9 13:38 .
drwxr-xr-x 3 deguzim amazon 4096 Mar 12  2021 ..

restore directory:

$ ls -la ~/.tmux/resurrect/restore/pane_contents 
total 8
drwxr-xr-x 2 deguzim amazon 4096 Aug  9 13:32 .
drwxr-xr-x 3 deguzim amazon 4096 Mar 12  2021 ..

Using latest code:

$ head CHANGELOG.md 
# Changelog

### master
- Remove deprecated "restoring shell history" feature.

### v4.0.0, 2022-04-10

I have this "workaround" in my tmux conf:

# Due to https://github.com/tmux-plugins/tmux-resurrect/issues/141, the pane
# contents are blank, this is the easiest workaround for now / least invasive
run "echo Dumping latest pane contents to ~/.tmux/resurrect/restore"
run "echo See: https://github.com/tmux-plugins/tmux-resurrect/issues/141"
run "/usr/bin/tar -xzvf ~/.tmux/resurrect/pane_contents.tar.gz -C ~/.tmux/resurrect/restore"

mdeguzis avatar Aug 09 '22 13:08 mdeguzis

I see it's due to how the archive is done, so it's merely a restore issue for me with the tar.gz:

  252     if capture_pane_contents_option_on; then
 253         mkdir -p "$(pane_contents_dir "save")"
  254         dump_pane_contents
  255         pane_contents_create_archive
 256         rm "$(pane_contents_dir "save")"/*
  257     fi

mdeguzis avatar Aug 09 '22 13:08 mdeguzis

I've got almost same problem here.

After a bit of research i found out, that it looked like cleaning in cleanup_restored_pane_contents happed before all restoration processes had been completed.

So, i guess, it should both deletes pane content file after it's pane restored in restore_pane function AND call cleanup_restored_pane_contents after post-restore-all hooks

tony-sol avatar May 07 '24 15:05 tony-sol