Commit Graph

64 Commits (cff343cf9e81983d3da0c8562b01616f12e8d548)

Author SHA1 Message Date
Bruno Sutic 6050d2d8d8
Remove deprecated "restoring shell history" 2022-04-10 08:58:27 +02:00
Jiří Málek 1ad109d3a8
Adds support for saving and restoring pane titles. 2022-04-09 13:52:28 +02:00
Bruno Sutic 6be2f34b5f
automatic-rename: changelog and comments 2021-08-30 14:17:15 +02:00
A Farzat 1b63a940a0 Fix even more bugs in before last commit
First, increment the relevant indices in the awk statements regarding
windows, as now the window_name entry exists.

Second, remove the window_name entry from the dump_pane_contents and
dump_shell_history functions as it no longer exists in the format.
2021-08-27 15:57:26 +09:00
A Farzat 02a7f1f9d6 Fix some of the errors in the last commit
First, make sure to include the ":" placeholder in the window_name
format.

Second, decrement the indices in relevant awk commands to make sure they
point to the right items.
2021-08-27 13:27:00 +09:00
A Farzat 6c9322aa99 Leave window name handling to windows
Previously, window names were set when creating panes and were therefore
saved with pane data. However, saving the names with window data is more
intuitive and easier to manage. In addition, one can set the name and
automatic-rename options in the same function, so one can make sure that
renaming the windows will not overwrite the automatic-rename option.
2021-08-26 07:00:49 +09:00
A Farzat 80adb917c1 Maintain the value of automatic-rename
When the session is restored, the windows are renamed to their original
names switching off automatic-rename, which can be undesirable.
Therefore the value of automatic-rename is now saved for each window and
restored after the renaming.

If the value is set, that value is saved and then applied. Otherwise, a
placeholder of ':' is placed instead, in which case the local option is
unset for that window (as it originally was).
2021-08-23 14:04:11 +09:00
Bruno Sutic 123d83c668
Do not output deleted files to stdout 2020-08-17 10:32:11 +02:00
Ash Berlin-Taylor e815c50f13
Make backup retention period configurable
For instance `tmux set-option -g @resurrect-delete-backup-after 1`
to only keep 1 day of backups.

Closes 252.
2020-08-17 10:28:42 +02:00
Graham Patterson a876ad6648 Adds a fix for directory paths with spaces that aren't escaped. 2019-03-01 10:37:01 -05:00
Ash Berlin-Taylor 8aa999c591 Add more hook points
And make the hook calling simpler at the call site.
2018-08-20 12:17:43 +01:00
Sergey Vlasov 0133c7a96a Save and restore hooks 2018-08-17 20:19:27 +01:00
Wouter R 2f5394bfed Remove superfluous if-block. 2018-01-27 19:08:28 +01:00
Wouter R 6d10ee01b6 Fix https://github.com/tmux-plugins/tmux-resurrect/issues/176.
This removes (un)zooming on save which should not be necessary anymore
with recent tmux versions (from 2.2 on?).
2018-01-24 18:20:44 +01:00
Eugene Van Dam 5f3873c502 remove_old_backups() : replace xargs with -exec to handle 0 files found
by find better
2017-10-25 14:30:50 +02:00
Bruno Sutic 3a31bfbbb8
Use 'xargs rm' instead of 'find -delete' 2017-06-04 00:52:37 +02:00
Bruno Sutic 241f62089a
Update changelog 2017-06-04 00:32:53 +02:00
Bruno Sutic fe8390a578
Resurrect file prefix and extension vars 2017-06-04 00:31:17 +02:00
Xu Cheng 9d81e8d026
auto remove old backup files
remove backup files older than 30 days, but keep at least 5 copies of backup.

Fixes #102.
2017-06-04 00:23:50 +02:00
Mohammad Alsaleh aaec581334
Immediately restore shell history after saving
This is necessary for zsh.

Signed-off-by: Mohammad Alsaleh <CE.Mohammad.AlSaleh@gmail.com>
2017-06-04 00:17:36 +02:00
Mohammad Alsaleh 2c9cc224c0
Rename dump_bash_history() to dump_shell_history()
Signed-off-by: Mohammad Alsaleh <CE.Mohammad.AlSaleh@gmail.com>
2017-06-04 00:16:52 +02:00
Mohammad Alsaleh 655ed8c6f4
Add @resurrect-save-shell-history option
Also make @resurrect-save-bash-history an alias to the new option.

Signed-off-by: Mohammad Alsaleh <CE.Mohammad.AlSaleh@gmail.com>
2017-06-04 00:16:51 +02:00
Mohammad Alsaleh e757e1b8a9
Add zsh support in save/restore functions
Signed-off-by: Mohammad Alsaleh <CE.Mohammad.AlSaleh@gmail.com>
2017-06-04 00:15:01 +02:00
Bruno Sutic b7a4ee2a40
Pane contents save and restore in separate dirs 2017-06-01 05:47:09 +02:00
Bruno Sutic ba59a2b642
Revert "remove pane contents cleanup to repair restore"
This reverts commit 0a6f90788f.
2017-05-30 06:14:21 +02:00
Bruno Sutic 8de2570960 Merge pull request #193 from Mellbourn/restore-pane-fix
remove pane contents cleanup to repair restore
2017-05-30 05:49:13 +02:00
Bruno Sutic b1f3df21e9
Create new file only if there are changes
Code submitted by @vburdo in
https://github.com/tmux-plugins/tmux-resurrect/issues/156
2017-05-30 05:14:14 +02:00
Klas Mellbourn 0a6f90788f remove pane contents cleanup to repair restore
as suggested in https://github.com/tmux-plugins/tmux-resurrect/issues/141
2017-05-07 19:35:06 +02:00
Heath Naylor 3bc852bbae Fix comparision operators. Fixes #124 2016-01-29 09:41:52 -07:00
Bruno Sutic 370b4861cb Revert "Symlink 'last' file at the end of successful save"
This reverts commit 6750a88e74.
2015-11-25 13:42:37 +01:00
Bruno Sutic 6750a88e74
Symlink 'last' file at the end of successful save 2015-11-25 13:40:54 +01:00
Bruno Sutic 5f04ceabbc
Add sleep when saving zoomed windows
When saving zoomed windows:

- window is un-zoomed
- window layout snapshot is taken
- window is zoomed back

This is done because otherwise tmux does not provide correct window
layout. With this we're working around a tmux bug really.

The above causes an issue with vim. For some reason vim cannot properly
reload it's content when "un-zoom + zoom" is done quickly. Everything
works ok if a little sleep/wait is added, so we're doing just that.
0.1 second sleep seems to be enough.

About `sleep 0.1 || sleep 1`: this is a hack. We want to wait for 0.1
seconds, which seems to be enough to fix the issue. However, according
to POSIX, `sleep` command takes only integers.
BUT, decimal values seem to work everywhere. So, we're using a decimal
value, and if that fails, we behave POSIX friendly.

Related to issue #112.
2015-10-26 01:22:46 +01:00
Bruno Sutic a47236d247
Implement pane content files compression 2015-07-10 18:01:20 +02:00
Bruno Sutic a750628a44
Change 'save pane contents' directory 2015-07-08 00:14:40 +02:00
Bruno Sutic 74773bed62
Save pane contents only if pane not blank 2015-07-08 00:02:20 +02:00
Bruno Sutic aa0b424ca6
Refactoring 2015-07-07 23:35:41 +02:00
Bruno Sutic 852af79075
Do not save empty trailing lines when pane content is saved 2015-07-07 19:23:47 +02:00
Bruno Sutic f3c6321501
Refactoring: drop dependency on command 2015-05-09 15:05:30 +02:00
Bruno Sutic fee40e2121
Capture pane contents feature, small refactor 2015-05-09 12:37:37 +02:00
quentin 737568922b Make "full" pane contents saving the default 2015-03-18 22:38:38 +01:00
quentin a1e3d37461 Correctly capture wrapped lines in the pane contents
Add the -J options to `capture-pane` to handle wrapped lines correctly.
This way wrapped lines will be joined upon capture and once restored,
will re-wrap upon pane size changes.
2015-03-18 10:14:20 +01:00
quentin 4f685d5c3d Add an option to save the full pane contents
By default only the visible pane area is captured and restored.
The @resurrect-pane-contents-area option lets the full pane area be
captured instead.
2015-03-17 04:13:54 +01:00
quentin b22b2a7203 Save and restore tmux pane contents
This feature is controlled by the '@resurrect-capture-pane-contents'
option.
Currently only the visible area of each pane is saved and restored.
2015-03-17 03:17:37 +01:00
Bruno Sutic b7e7669999
Improve fetching "window_layout" value
It's faster now.
2015-02-12 14:10:56 +01:00
Bruno Sutic abad85f03b
Enable quiet saving 2015-02-12 12:53:19 +01:00
Bruno Sutic 028e7b7c2e
Refactoring: prefer using variable with tab character 2015-02-10 12:48:53 +01:00
Bruno Sutic b502572a07
Restore active and alternate windows only if they are present in the 'last' file 2015-02-10 12:48:53 +01:00
Bruno Sutic 1c8efb034a
If there are no grouped sessions, do not output empty line 2015-02-10 12:48:53 +01:00
Bruno Sutic 95ec3c1d9b
Save and restore active and alternate windows for grouped sessions 2015-02-10 12:48:53 +01:00
Bruno Sutic bfc625e13f
Save grouped sessions
Grouped sessions are session started with the command
`tmux new-session -t <existing-session-name>`

Those sessions share the panes and windows with the existing, original
session.
We're making sure to identify and save grouped sessions.
On the other hand, we don't want to save panes and windows twice
2015-02-10 12:48:53 +01:00