From 1c8efb034acb2957f2b79a1bdc2108d7ef2ccf08 Mon Sep 17 00:00:00 2001 From: Bruno Sutic Date: Mon, 9 Feb 2015 16:05:36 +0100 Subject: [PATCH] If there are no grouped sessions, do not output empty line --- CHANGELOG.md | 1 + scripts/save.sh | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9ad2ffa..192c1f8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ as other tweaks - save and restore grouped sessions (used with multi-monitor workflow) - save and restore active and alternate windows in grouped sessions +- if there are no grouped sessions, do not output empty line to "last" file ### v1.5.0, 2014-11-09 - add support for restoring neovim sessions diff --git a/scripts/save.sh b/scripts/save.sh index 66ba70f..4373bcd 100755 --- a/scripts/save.sh +++ b/scripts/save.sh @@ -150,7 +150,9 @@ dump_grouped_sessions() { fetch_and_dump_grouped_sessions(){ local grouped_sessions_dump="$(dump_grouped_sessions)" get_grouped_sessions "$grouped_sessions_dump" - echo "$grouped_sessions_dump" + if [ -n "$grouped_sessions_dump" ]; then + echo "$grouped_sessions_dump" + fi } # translates pane pid to process command running inside a pane