Enable quiet saving

This commit is contained in:
Bruno Sutic 2015-02-12 12:53:19 +01:00
parent e1b01ee4f9
commit abad85f03b
No known key found for this signature in database
GPG Key ID: 66D96E4F2F7EF26C
2 changed files with 15 additions and 3 deletions

View File

@ -4,6 +4,7 @@
- bugfix: zoomed windows related regression - bugfix: zoomed windows related regression
- export save and restore script paths so that 'tmux-resurrect-save' plugin can - export save and restore script paths so that 'tmux-resurrect-save' plugin can
use them use them
- enable "quiet" saving (used by 'tmux-resurrect-save' plugin)
### v2.1.0, 2015-02-12 ### v2.1.0, 2015-02-12
- if restore is started when there's only **1 pane in the whole tmux server**, - if restore is started when there's only **1 pane in the whole tmux server**,

View File

@ -10,6 +10,9 @@ source "$CURRENT_DIR/spinner_helpers.sh"
d=$'\t' d=$'\t'
delimiter=$'\t' delimiter=$'\t'
# if "quiet" script produces no output
SCRIPT_OUTPUT="$1"
grouped_sessions_format() { grouped_sessions_format() {
local format local format
format+="#{session_grouped}" format+="#{session_grouped}"
@ -210,12 +213,20 @@ save_all() {
restore_zoomed_windows restore_zoomed_windows
} }
show_output() {
[ "$SCRIPT_OUTPUT" != "quiet" ]
}
main() { main() {
if supported_tmux_version_ok; then if supported_tmux_version_ok; then
if show_output; then
start_spinner "Saving..." "Tmux environment saved!" start_spinner "Saving..." "Tmux environment saved!"
fi
save_all save_all
if show_output; then
stop_spinner stop_spinner
display_message "Tmux environment saved!" display_message "Tmux environment saved!"
fi fi
fi
} }
main main