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>
pull/151/merge
Mohammad Alsaleh 2015-09-16 19:06:41 +03:00 committed by Bruno Sutic
parent e757e1b8a9
commit 655ed8c6f4
No known key found for this signature in database
GPG Key ID: CAFA7B1B2914ED81
4 changed files with 10 additions and 5 deletions

View File

@ -62,9 +62,11 @@ files_differ() {
! cmp -s "$1" "$2"
}
save_bash_history_option_on() {
local option="$(get_tmux_option "$bash_history_option" "off")"
[ "$option" == "on" ]
save_shell_history_option_on() {
local option_shell="$(get_tmux_option "$shell_history_option" "off")"
local option_bash="$(get_tmux_option "$bash_history_option" "off")"
[ "$option_shell" == "on" ] || [ "$option_bash" == "on" ]
}
get_grouped_sessions() {

View File

@ -346,7 +346,7 @@ main() {
start_spinner "Restoring..." "Tmux restore complete!"
restore_all_panes
restore_pane_layout_for_each_window >/dev/null 2>&1
if save_bash_history_option_on; then
if save_shell_history_option_on; then
restore_shell_history
fi
restore_all_pane_processes

View File

@ -292,8 +292,8 @@ save_all() {
pane_contents_create_archive
rm "$(pane_contents_dir "save")"/*
fi
if save_bash_history_option_on; then
dump_bash_history
if save_shell_history_option_on; then
fi
}

View File

@ -37,7 +37,10 @@ pane_contents_option="@resurrect-capture-pane-contents"
pane_contents_area_option="@resurrect-pane-contents-area"
default_pane_contents_area="full"
# Keep @resurrect-save-bash-history for backward compatibility.
# It's effectively an alias to @resurrect-save-shell-history.
bash_history_option="@resurrect-save-bash-history"
shell_history_option="@resurrect-save-shell-history"
# set to 'on' to ensure panes are never ever overwritten
overwrite_option="@resurrect-never-overwrite"