mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-15 22:05:24 -05:00
Extract function for reporting color theme mode
This commit is contained in:
parent
6ab7190d74
commit
7e2ea901d6
3 changed files with 24 additions and 23 deletions
16
csi.c
16
csi.c
|
|
@ -1566,21 +1566,7 @@ csi_dispatch(struct terminal *term, uint8_t final)
|
|||
|
||||
switch (param) {
|
||||
case 996: { /* Query current theme mode (see private mode 2031) */
|
||||
/*
|
||||
* 1 - dark mode
|
||||
* 2 - light mode
|
||||
*
|
||||
* In foot, the themes aren't necessarily light/dark,
|
||||
* but by convention, the primary theme is dark, and
|
||||
* the alternative theme is light.
|
||||
*/
|
||||
char reply[16] = {0};
|
||||
int chars = snprintf(
|
||||
reply, sizeof(reply),
|
||||
"\033[?997;%dn",
|
||||
term->colors.active_theme == COLOR_THEME1 ? 1 : 2);
|
||||
|
||||
term_to_slave(term, reply, chars);
|
||||
term_send_color_theme_mode(term);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue