mirror of
				https://github.com/tmux-plugins/tmux-resurrect.git
				synced 2025-11-04 00:46:04 +00:00 
			
		
		
		
	Flag gate the bash history restore feature
This commit is contained in:
		@@ -49,6 +49,11 @@ remove_first_char() {
 | 
				
			|||||||
	echo "$1" | cut -c2-
 | 
						echo "$1" | cut -c2-
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					save_bash_history_option_on() {
 | 
				
			||||||
 | 
						local option="$(get_tmux_option "$bash_history_option" "off")"
 | 
				
			||||||
 | 
						[ "$option" == "on" ]
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# path helpers
 | 
					# path helpers
 | 
				
			||||||
 | 
					
 | 
				
			||||||
resurrect_dir() {
 | 
					resurrect_dir() {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -211,7 +211,9 @@ main() {
 | 
				
			|||||||
		start_spinner "Restoring..." "Tmux restore complete!"
 | 
							start_spinner "Restoring..." "Tmux restore complete!"
 | 
				
			||||||
		restore_all_panes
 | 
							restore_all_panes
 | 
				
			||||||
		restore_pane_layout_for_each_window >/dev/null 2>&1
 | 
							restore_pane_layout_for_each_window >/dev/null 2>&1
 | 
				
			||||||
		restore_shell_history
 | 
							if save_bash_history_option_on; then
 | 
				
			||||||
 | 
								restore_shell_history
 | 
				
			||||||
 | 
							fi
 | 
				
			||||||
		restore_all_pane_processes
 | 
							restore_all_pane_processes
 | 
				
			||||||
		# below functions restore exact cursor positions
 | 
							# below functions restore exact cursor positions
 | 
				
			||||||
		restore_active_pane_for_each_window
 | 
							restore_active_pane_for_each_window
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -129,7 +129,9 @@ save_all() {
 | 
				
			|||||||
	dump_windows >> $resurrect_file_path
 | 
						dump_windows >> $resurrect_file_path
 | 
				
			||||||
	dump_state   >> $resurrect_file_path
 | 
						dump_state   >> $resurrect_file_path
 | 
				
			||||||
	ln -fs "$resurrect_file_path" "$(last_resurrect_file)"
 | 
						ln -fs "$resurrect_file_path" "$(last_resurrect_file)"
 | 
				
			||||||
	dump_bash_history
 | 
						if save_bash_history_option_on; then
 | 
				
			||||||
 | 
							dump_bash_history
 | 
				
			||||||
 | 
						fi
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
main() {
 | 
					main() {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -26,3 +26,5 @@ inline_strategy_token="->"
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
save_command_strategy_option="@resurrect-save-command-strategy"
 | 
					save_command_strategy_option="@resurrect-save-command-strategy"
 | 
				
			||||||
default_save_command_strategy="ps"
 | 
					default_save_command_strategy="ps"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					bash_history_option="@resurrect-save-bash-history"
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user