From 4ce8f6d2501167d0bf201be89762c831037eb66c Mon Sep 17 00:00:00 2001 From: Arthur Sonzogni Date: Fri, 31 Mar 2023 17:44:01 +0200 Subject: [PATCH] Fix useless new line when using the alternative screen. (#610) Fix:https://github.com/ArthurSonzogni/FTXUI/issues/609 --- CHANGELOG.md | 1 + src/ftxui/component/screen_interactive.cpp | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 39ef3c7..4dd1eb6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ current (development) ### Component - Feature: Support `ResizableSplit` with customizable separator. - Breaking: MenuDirection enum is renamed Direction +- Fix: Remove useless new line when using an alternative screen. ### Dom - Feature: Add the dashed style for border and separator. diff --git a/src/ftxui/component/screen_interactive.cpp b/src/ftxui/component/screen_interactive.cpp index 9f4eba7..dfca52e 100644 --- a/src/ftxui/component/screen_interactive.cpp +++ b/src/ftxui/component/screen_interactive.cpp @@ -460,9 +460,13 @@ void ScreenInteractive::PostMain() { g_active_screen->Install(); } else { Uninstall(); + + std::cout << '\r'; // On final exit, keep the current drawing and reset cursor position one // line after it. - std::cout << std::endl; + if (!use_alternative_screen_) { + std::cout << std::endl; + } } }