]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
terminal-util: reset /dev/console via ansi seq also in make_console_stdio()
authorLennart Poettering <lennart@poettering.net>
Wed, 10 Jul 2024 15:53:58 +0000 (17:53 +0200)
committerLennart Poettering <lennart@poettering.net>
Fri, 19 Jul 2024 09:41:43 +0000 (11:41 +0200)
This appears to have been the intention of
00bc83a275fa3ca8d90579fe9597d8b651d47332, judging by the comments on
that.

src/basic/terminal-util.c

index d6fd41e3ce071e3a7b7aadb0f376e54321c76f41..92abd52a2ef780b86e25b983d55529b5826afcbf 100644 (file)
@@ -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");