]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
Revert "terminal-util: explicitly reset cursor"
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Fri, 5 Sep 2025 06:22:00 +0000 (08:22 +0200)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Fri, 5 Sep 2025 09:18:51 +0000 (11:18 +0200)
This reverts commit b177095bfac9d04871762cff4febfca43e790529.

The original issue (https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=375275,
https://github.com/systemd/systemd/issues/22168) was about having a block
cursor instead of a box cursor after VM reset, which doesn't seem particularly
urgent. OTOH, the patch causes a minor regression, where the splash screen is
cleared immediately and replaced by a blinking cursor. With the patch, we are
trading one visual issue for another visual issue. The second is probably more
noticeable, since some poeple put in quite a lot of work to have pretty boots
where the firmware splash screen is displayed until the login prompt pops up.
Avoiding a regression is more important than fixing a minor long-standing
issue, so let's revert this.

Fixes https://github.com/systemd/systemd/issues/38752.

src/basic/terminal-util.c

index 0c9f52685b36724d705304e3531a39742c53134b..2106d0db8c7d878c59908d1f8dd50b90b973da75 100644 (file)
 #include "time-util.h"
 #include "utf8.h"
 
-#define ANSI_RESET_CURSOR                          \
-        "\033?25h"     /* turn on cursor */        \
-        "\033?12l"     /* reset cursor blinking */ \
-        "\033 1q"      /* reset cursor style */
-
 /* How much to wait for a reply to a terminal sequence */
 #define CONSOLE_REPLY_WAIT_USEC  (333 * USEC_PER_MSEC)
 
@@ -857,7 +852,6 @@ int vt_disallocate(const char *tty_path) {
                 return fd2;
 
         return loop_write_full(fd2,
-                               ANSI_RESET_CURSOR
                                "\033[r"   /* clear scrolling region */
                                "\033[H"   /* move home */
                                "\033[3J"  /* clear screen including scrollback, requires Linux 2.6.40 */
@@ -974,7 +968,6 @@ static int terminal_reset_ansi_seq(int fd) {
                 return log_debug_errno(r, "Failed to set terminal to non-blocking mode: %m");
 
         k = loop_write_full(fd,
-                            ANSI_RESET_CURSOR
                             "\033[!p"      /* soft terminal reset */
                             "\033]104\007" /* reset colors */
                             "\033[?7h"     /* enable line-wrapping */