From b81a6eb0374da18b5534e7b4058b505c079c409e Mon Sep 17 00:00:00 2001 From: Scrub <72096833+ScrubN@users.noreply.github.com> Date: Thu, 9 May 2024 15:36:18 -0400 Subject: [PATCH] Add a newline to the end of stdout before exiting (#1052) --- TwitchDownloaderCLI/Tools/CliTaskProgress.cs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/TwitchDownloaderCLI/Tools/CliTaskProgress.cs b/TwitchDownloaderCLI/Tools/CliTaskProgress.cs index c0fa4a33..7b873c82 100644 --- a/TwitchDownloaderCLI/Tools/CliTaskProgress.cs +++ b/TwitchDownloaderCLI/Tools/CliTaskProgress.cs @@ -250,5 +250,15 @@ private void WriteNewLineMessage(string preamble, string message) Console.WriteLine(message); _lastWriteHadNewLine = true; } + + ~CliTaskProgress() + { + if (!_lastWriteHadNewLine) + { + // Some shells don't like when an application exits without writing a newline to the end of stdout + Console.WriteLine(); + _lastWriteHadNewLine = true; + } + } } } \ No newline at end of file