1
0
mirror of https://github.com/tmux/tmux.git synced 2025-04-16 16:38:49 +00:00

Do not try to trigger theme changed if session is NULL.

This commit is contained in:
nicm 2025-03-30 22:01:55 +00:00
parent 53b0e0bc02
commit ef923d28ff
2 changed files with 8 additions and 6 deletions

View File

@ -363,7 +363,7 @@ session_detach(struct session *s, struct winlink *wl)
if (RB_EMPTY(&s->windows)) if (RB_EMPTY(&s->windows))
return (1); return (1);
return (0); return (0);
} }
/* Return if session has window. */ /* Return if session has window. */
@ -761,8 +761,10 @@ session_theme_changed(struct session *s)
struct window_pane *wp; struct window_pane *wp;
struct winlink *wl; struct winlink *wl;
RB_FOREACH(wl, winlinks, &s->windows) { if (s != NULL) {
TAILQ_FOREACH(wp, &wl->window->panes, entry) RB_FOREACH(wl, winlinks, &s->windows) {
wp->flags |= PANE_THEMECHANGED; TAILQ_FOREACH(wp, &wl->window->panes, entry)
wp->flags |= PANE_THEMECHANGED;
}
} }
} }

View File

@ -795,12 +795,12 @@ tty_keys_next(struct tty *tty)
switch (tty_keys_colours(tty, buf, len, &size, &tty->fg, &tty->bg)) { switch (tty_keys_colours(tty, buf, len, &size, &tty->fg, &tty->bg)) {
case 0: /* yes */ case 0: /* yes */
key = KEYC_UNKNOWN; key = KEYC_UNKNOWN;
session_theme_changed(tty->client->session); session_theme_changed(c->session);
goto complete_key; goto complete_key;
case -1: /* no, or not valid */ case -1: /* no, or not valid */
break; break;
case 1: /* partial */ case 1: /* partial */
session_theme_changed(tty->client->session); session_theme_changed(c->session);
goto partial_key; goto partial_key;
} }