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

how do i clear saved tmux-ressurect ?

Open sandikodev opened this issue 5 years ago • 5 comments

there's any ways for cleaning/clear my tmux-resurrect saved session ? iam sorry if duplicated, let me know

sandikodev avatar May 04 '20 16:05 sandikodev

The default location of the saved session is under ~/.tmux/resurrect with last linking to the latest file. Editing the file should work as well as deleting it.

daonb avatar May 11 '20 07:05 daonb

Another idea would be open tmux in a default state, and then save it.

It is not same as clearing the saved session though.

jiaming10 avatar May 15 '20 01:05 jiaming10

--EDIT not needed, see below --

I added this to the top of my .tmux.conf

run -b "(cd ~/.tmux/resurrect; ls -tp | grep -v '/$' | tail -n +5 | xargs -I {} rm -- {})"

It will clean all but the latest 4 files every time the config is reloaded

If you choose to use it make sure the folder it changes to in the script matches the path to your resurrect folder.

lexjacobs avatar Jul 12 '20 23:07 lexjacobs

Just learned from the author of this plugin that tmux-resurrect already handles this

https://github.com/tmux-plugins/tmux-resurrect/blob/da1a7558024b8552f7262b39ed22e3d679304f99/scripts/save.sh#L271-L277

lexjacobs avatar Jul 14 '20 19:07 lexjacobs

Removing the entire .tmux/resurrect directory or its relevant contents will clear your saved session(s).

Where the default location is for this depends on a number of factors:

https://github.com/tmux-plugins/tmux-resurrect/blob/dd36a4561b0bb41987cccc299c85475012d8cf8b/scripts/helpers.sh#L1-L5

In short, it'll be at ~/.tmux/resurrect if that already exists (e.g. legacy support), or else at ~/.local/share/tmux/resurrect, unless XDG_DATA_HOME or HOME are set differently.

davidjb avatar Jul 26 '24 00:07 davidjb