From abad85f03bd7e2231a140a256ee46021cc60a65d Mon Sep 17 00:00:00 2001 From: Bruno Sutic Date: Thu, 12 Feb 2015 12:53:19 +0100 Subject: [PATCH] Enable quiet saving --- CHANGELOG.md | 1 + scripts/save.sh | 17 ++++++++++++++--- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f119b12..95e2175 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ - bugfix: zoomed windows related regression - export save and restore script paths so that 'tmux-resurrect-save' plugin can use them +- enable "quiet" saving (used by 'tmux-resurrect-save' plugin) ### v2.1.0, 2015-02-12 - if restore is started when there's only **1 pane in the whole tmux server**, diff --git a/scripts/save.sh b/scripts/save.sh index d8f4890..e6f4e7d 100755 --- a/scripts/save.sh +++ b/scripts/save.sh @@ -10,6 +10,9 @@ source "$CURRENT_DIR/spinner_helpers.sh" d=$'\t' delimiter=$'\t' +# if "quiet" script produces no output +SCRIPT_OUTPUT="$1" + grouped_sessions_format() { local format format+="#{session_grouped}" @@ -210,12 +213,20 @@ save_all() { restore_zoomed_windows } +show_output() { + [ "$SCRIPT_OUTPUT" != "quiet" ] +} + main() { if supported_tmux_version_ok; then - start_spinner "Saving..." "Tmux environment saved!" + if show_output; then + start_spinner "Saving..." "Tmux environment saved!" + fi save_all - stop_spinner - display_message "Tmux environment saved!" + if show_output; then + stop_spinner + display_message "Tmux environment saved!" + fi fi } main