diff options
author | Lennart Poettering <lennart@poettering.net> | 2024-07-10 17:53:58 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2024-07-19 11:41:43 +0200 |
commit | 963e25c23b1e5dd1b9fbf7b12a1d3ba7ac3deed2 (patch) | |
tree | 71c14b3f7be7f0f4035c060f25dd98dde8d075a4 /src/basic/terminal-util.c | |
parent | terminal-util: try to initialize rows/cols via ansi sequence in make_console_... (diff) | |
download | systemd-963e25c23b1e5dd1b9fbf7b12a1d3ba7ac3deed2.tar.xz systemd-963e25c23b1e5dd1b9fbf7b12a1d3ba7ac3deed2.zip |
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.
Diffstat (limited to 'src/basic/terminal-util.c')
-rw-r--r-- | src/basic/terminal-util.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/basic/terminal-util.c b/src/basic/terminal-util.c index d6fd41e3ce..92abd52a2e 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"); |