version 1.167, 2023/06/30 13:19:32 |
version 1.168, 2023/09/02 20:03:10 |
|
|
int n; |
int n; |
|
|
*size = 0; |
*size = 0; |
if ((tty->flags & TTY_HAVEFG) && (tty->flags & TTY_HAVEBG)) |
|
return (-1); |
|
|
|
/* First four bytes are always \033]1 and 0 or 1 and ;. */ |
/* First four bytes are always \033]1 and 0 or 1 and ;. */ |
if (buf[0] != '\033') |
if (buf[0] != '\033') |
|
|
if (n != -1 && buf[3] == '0') { |
if (n != -1 && buf[3] == '0') { |
log_debug("%s: foreground is %s", c->name, colour_tostring(n)); |
log_debug("%s: foreground is %s", c->name, colour_tostring(n)); |
tty->fg = n; |
tty->fg = n; |
tty->flags |= TTY_HAVEFG; |
|
} else if (n != -1) { |
} else if (n != -1) { |
log_debug("%s: background is %s", c->name, colour_tostring(n)); |
log_debug("%s: background is %s", c->name, colour_tostring(n)); |
tty->bg = n; |
tty->bg = n; |
tty->flags |= TTY_HAVEBG; |
|
} |
} |
|
|
return (0); |
return (0); |