mirror of
				https://github.com/tmux-plugins/tmux-continuum.git
				synced 2025-11-04 00:07:32 +00:00 
			
		
		
		
	Improve initial plugin save delay
This commit is contained in:
		@@ -4,6 +4,8 @@
 | 
			
		||||
- do not auto-restore tmux environment if another tmux server is already running
 | 
			
		||||
  (we don't want to duplicate stuff)
 | 
			
		||||
- bugfixes for 'tmux auto start' OS X Terminal.app and iTerm scripts
 | 
			
		||||
- prevent saving for the first 15 minutes only when plugin is sourced the first
 | 
			
		||||
  time (not on subsequent sources or tmux.conf reloads)
 | 
			
		||||
 | 
			
		||||
### v2.1.0, 2015-02-18
 | 
			
		||||
- enable "tmux auto start" for OS X
 | 
			
		||||
 
 | 
			
		||||
@@ -16,6 +16,13 @@ handle_tmux_automatic_start() {
 | 
			
		||||
	$CURRENT_DIR/scripts/handle_tmux_automatic_start.sh
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
delay_saving_environment_on_first_plugin_load() {
 | 
			
		||||
	if [ -z "$(get_tmux_option "$last_auto_save_option" "")" ]; then
 | 
			
		||||
		# last save option not set, this is first time plugin load
 | 
			
		||||
		set_last_save_timestamp
 | 
			
		||||
	fi
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
add_resurrect_save_interpolation() {
 | 
			
		||||
	local status_right_value="$(get_tmux_option "status-right" "")"
 | 
			
		||||
	local new_value="${save_command_interpolation}${status_right_value}"
 | 
			
		||||
@@ -37,9 +44,8 @@ main() {
 | 
			
		||||
	if supported_tmux_version_ok; then
 | 
			
		||||
		handle_tmux_automatic_start
 | 
			
		||||
 | 
			
		||||
		# Don't start saving right after tmux is started.
 | 
			
		||||
		# We wanna give user a chance to restore previous session.
 | 
			
		||||
		set_last_save_timestamp
 | 
			
		||||
		# give user a chance to restore previously saved session
 | 
			
		||||
		delay_saving_environment_on_first_plugin_load
 | 
			
		||||
		add_resurrect_save_interpolation
 | 
			
		||||
 | 
			
		||||
		if just_started_tmux_server; then
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user