Skip to content

Commit aaf3515

Browse files
committed
Add option to set restore max delay
This enables the user to set a custom max delay time for the auto restore process to trigger. When the .tmux.conf loads multiple or slow plugins 10 seconds is not enough.
1 parent c7f12ce commit aaf3515

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

continuum.tmux

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,9 @@ add_resurrect_save_interpolation() {
4646
just_started_tmux_server() {
4747
local tmux_start_time
4848
tmux_start_time="$(tmux display-message -p -F '#{start_time}')"
49-
[ "$tmux_start_time" == "" ] || [ "$tmux_start_time" -gt "$(($(date +%s)-10))" ]
49+
local restore_max_delay
50+
restore_max_delay="$(get_tmux_option "$auto_restore_max_delay_option" "${auto_restore_max_delay_default}")"
51+
[ "$tmux_start_time" == "" ] || [ "$tmux_start_time" -gt "$(($(date +%s)-${restore_max_delay}))" ]
5052
}
5153

5254
start_auto_restore_in_background() {

scripts/variables.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ auto_restore_default="off"
1515

1616
auto_restore_halt_file="${HOME}/tmux_no_auto_restore"
1717

18+
auto_restore_max_delay_option="@continuum-restore-max-delay"
19+
auto_restore_max_delay_default="10"
20+
1821
# tmux auto start options
1922
auto_start_option="@continuum-boot"
2023
auto_start_default="off"

0 commit comments

Comments
 (0)