]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
terminal-util: also send ANSI_NORMAL in terminal_reset_ansi_seq
authorJörg Behrmann <behrmann@physik.fu-berlin.de>
Mon, 22 Dec 2025 15:58:28 +0000 (16:58 +0100)
committerLennart Poettering <lennart@poettering.net>
Wed, 24 Dec 2025 06:59:42 +0000 (07:59 +0100)
Certain terminal emulators (alacritty, ghostty and kitty) require ANSI_NORMAL
to be sent to reset the colours.

Followup for 3d97db8f3c3e86b70d09444965ebfddd051df39c.

Fixes: #40163
src/basic/terminal-util.c

index 9abef38aadcf9482a689760353976ff491c159d7..ce3a76bdd00f3fe468cced76e24d5756f76b624b 100644 (file)
@@ -969,7 +969,8 @@ int terminal_reset_ansi_seq(int fd) {
 
         k = loop_write_full(fd,
                             "\033[!p"      /* soft terminal reset */
-                            "\033]104\007" /* reset colors */
+                            "\033]104\007" /* reset colors via OSC104 */
+                            ANSI_NORMAL    /* reset colors */
                             "\033[?7h"     /* enable line-wrapping */
                             "\033[1G"      /* place cursor at beginning of current line */
                             "\033[0J",     /* erase till end of screen */