mirror of
https://github.com/tmux/tmux.git
synced 2026-07-08 10:29:32 +00:00
Infer the terminal theme from the background colour correctly, if theme
reporting is not supported.
This commit is contained in:
@@ -1197,6 +1197,8 @@ server_client_update_theme_colours(struct client *c)
|
||||
format_defaults(ft, c, NULL, NULL, NULL);
|
||||
|
||||
theme = c->theme;
|
||||
if (theme == THEME_UNKNOWN)
|
||||
theme = colour_totheme(c->tty.bg);
|
||||
if (option == 2)
|
||||
theme = THEME_LIGHT;
|
||||
else if (option == 3)
|
||||
|
||||
@@ -751,7 +751,7 @@ tty_keys_next(struct tty *tty)
|
||||
const char *buf;
|
||||
size_t len, size;
|
||||
cc_t bspace;
|
||||
int delay, expired = 0, n;
|
||||
int delay, expired = 0, n, bg = tty->bg;
|
||||
key_code key, onlykey;
|
||||
struct mouse_event m = { 0 };
|
||||
struct key_event *event;
|
||||
@@ -811,11 +811,15 @@ tty_keys_next(struct tty *tty)
|
||||
switch (tty_keys_colours(tty, buf, len, &size, &tty->fg, &tty->bg)) {
|
||||
case 0: /* yes */
|
||||
key = KEYC_UNKNOWN;
|
||||
if (tty->bg != bg)
|
||||
server_client_update_theme_colours(c);
|
||||
session_theme_changed(c->session);
|
||||
goto complete_key;
|
||||
case -1: /* no, or not valid */
|
||||
break;
|
||||
case 1: /* partial */
|
||||
if (tty->bg != bg)
|
||||
server_client_update_theme_colours(c);
|
||||
session_theme_changed(c->session);
|
||||
goto partial_key;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user