From 852af7907597dc445e2e28a9be423ef2fdb170df Mon Sep 17 00:00:00 2001 From: Bruno Sutic Date: Tue, 7 Jul 2015 19:23:47 +0200 Subject: [PATCH] Do not save empty trailing lines when pane content is saved --- CHANGELOG.md | 1 + scripts/save.sh | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7d3f738..cbf963c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ - refactoring: drop dependency on `paste` command - bugfix for pane contents restoration - expand tilde char `~` if used with `@resurrect-dir` +- do not save empty trailing lines when pane content is saved ### v2.4.0, 2015-02-23 - add "tmux-test" diff --git a/scripts/save.sh b/scripts/save.sh index 672c8e0..e17e02f 100755 --- a/scripts/save.sh +++ b/scripts/save.sh @@ -117,7 +117,7 @@ capture_pane_contents() { if [ "$pane_contents_area" = "visible" ]; then start_line="0" fi - tmux capture-pane -epJ -S "$start_line" -t "$pane_id" > "$(resurrect_pane_file "$pane_id")" + printf '%s\n' "$(tmux capture-pane -epJ -S "$start_line" -t "$pane_id")" > "$(resurrect_pane_file "$pane_id")" } save_shell_history() {