terminal-util: define ANSI_OSC as macro for the OSC terminal sequence prefix
This commit is contained in:
@@ -1923,12 +1923,12 @@ int get_default_background_color(double *ret_red, double *ret_green, double *ret
|
||||
if (tcsetattr(STDIN_FILENO, TCSADRAIN, &new_termios) < 0)
|
||||
return -errno;
|
||||
|
||||
r = loop_write(STDOUT_FILENO, "\x1B]11;?" ANSI_ST, SIZE_MAX);
|
||||
r = loop_write(STDOUT_FILENO, ANSI_OSC "11;?" ANSI_ST, SIZE_MAX);
|
||||
if (r < 0)
|
||||
goto finish;
|
||||
|
||||
usec_t end = usec_add(now(CLOCK_MONOTONIC), 333 * USEC_PER_MSEC);
|
||||
char buf[STRLEN("\x1B]11;rgb:0/0/0" ANSI_ST)]; /* shortest possible reply */
|
||||
char buf[STRLEN(ANSI_OSC "11;rgb:0/0/0" ANSI_ST)]; /* shortest possible reply */
|
||||
size_t buf_full = 0;
|
||||
BackgroundColorContext context = {};
|
||||
|
||||
|
||||
@@ -34,6 +34,9 @@
|
||||
* use 0x1B 0x5c */
|
||||
#define ANSI_ST "\e\\"
|
||||
|
||||
/* The "operating system command" ("OSC") start sequence */
|
||||
#define ANSI_OSC "\e]"
|
||||
|
||||
bool isatty_safe(int fd);
|
||||
|
||||
int terminal_reset_defensive(int fd, bool switch_to_text);
|
||||
|
||||
Reference in New Issue
Block a user