From 963e25c23b1e5dd1b9fbf7b12a1d3ba7ac3deed2 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Wed, 10 Jul 2024 17:53:58 +0200 Subject: [PATCH] terminal-util: reset /dev/console via ansi seq also in make_console_stdio() This appears to have been the intention of 00bc83a275fa3ca8d90579fe9597d8b651d47332, judging by the comments on that. --- src/basic/terminal-util.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/basic/terminal-util.c b/src/basic/terminal-util.c index d6fd41e3ce0..92abd52a2ef 100644 --- a/src/basic/terminal-util.c +++ b/src/basic/terminal-util.c @@ -614,6 +614,10 @@ int make_console_stdio(void) { } else (void) terminal_fix_size(fd, fd); + r = terminal_reset_ansi_seq(fd); + if (r < 0) + log_warning_errno(r, "Failed to reset terminal using ANSI sequences, ignoring: %m"); + r = rearrange_stdio(fd, fd, fd); /* This invalidates 'fd' both on success and on failure. */ if (r < 0) return log_error_errno(r, "Failed to make terminal stdin/stdout/stderr: %m"); -- 2.47.3