There are multiple ways to encode ANSI ST, and we generally prefer ESC \
for it, for reasons explained in terminal-util.h. Hence, let's actually
follow this rule in the terminal reset logic, and use the ANSI_ST macro.
This will change the byte sequence generated (as it means we use ESC \
rather than BEL), but it doesn't change behaviour, as the two sequences
should be equivalent.
return log_debug_errno(r, "Failed to set terminal to non-blocking mode: %m");
k = loop_write_full(fd,
- "\033[!p" /* soft terminal reset */
- "\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 */
+ "\033[!p" /* soft terminal reset */
+ ANSI_OSC "104" ANSI_ST /* reset color palette via OSC 104 */
+ 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 */
SIZE_MAX,
100 * USEC_PER_MSEC);
if (k < 0)