Merge branch 'obsd-master'

This commit is contained in:
Thomas Adam
2026-05-05 16:01:08 +01:00
3 changed files with 25 additions and 4 deletions

View File

@@ -355,6 +355,9 @@ control_set_pane_off(struct client *c, struct window_pane *wp)
struct control_pane *cp;
cp = control_add_pane(c, wp);
control_discard_pane(c, cp);
memcpy(&cp->offset, &wp->offset, sizeof cp->offset);
memcpy(&cp->queued, &wp->offset, sizeof cp->queued);
cp->flags |= CONTROL_PANE_OFF;
}

View File

@@ -277,6 +277,16 @@ screen_push_title(struct screen *s)
{
struct screen_title_entry *title_entry;
log_debug("%s: %u", __func__, s->ntitles);
while (s->ntitles >= 10) {
title_entry = TAILQ_LAST(s->titles, screen_titles);
free(title_entry->text);
TAILQ_REMOVE(s->titles, title_entry, entry);
free(title_entry);
s->ntitles--;
}
if (s->titles == NULL) {
s->titles = xmalloc(sizeof *s->titles);
TAILQ_INIT(s->titles);
@@ -284,6 +294,7 @@ screen_push_title(struct screen *s)
title_entry = xmalloc(sizeof *title_entry);
title_entry->text = xstrdup(s->title);
TAILQ_INSERT_HEAD(s->titles, title_entry, entry);
s->ntitles++;
}
/*
@@ -297,14 +308,15 @@ screen_pop_title(struct screen *s)
if (s->titles == NULL)
return;
log_debug("%s: %u", __func__, s->ntitles);
title_entry = TAILQ_FIRST(s->titles);
if (title_entry != NULL) {
screen_set_title(s, title_entry->text);
free(s->title);
s->title = title_entry->text;
TAILQ_REMOVE(s->titles, title_entry, entry);
free(title_entry->text);
free(title_entry);
s->ntitles--;
}
}
@@ -787,6 +799,8 @@ screen_mode_to_string(int mode)
strlcat(tmp, "CURSOR_BLINKING,", sizeof tmp);
if (mode & MODE_CURSOR_VERY_VISIBLE)
strlcat(tmp, "CURSOR_VERY_VISIBLE,", sizeof tmp);
if (mode & MODE_CURSOR_BLINKING_SET)
strlcat(tmp, "CURSOR_BLINKING_SET,", sizeof tmp);
if (mode & MODE_MOUSE_UTF8)
strlcat(tmp, "MOUSE_UTF8,", sizeof tmp);
if (mode & MODE_MOUSE_SGR)
@@ -807,7 +821,10 @@ screen_mode_to_string(int mode)
strlcat(tmp, "KEYS_EXTENDED_2,", sizeof tmp);
if (mode & MODE_THEME_UPDATES)
strlcat(tmp, "THEME_UPDATES,", sizeof tmp);
tmp[strlen(tmp) - 1] = '\0';
if (mode & MODE_SYNC)
strlcat(tmp, "SYNC,", sizeof tmp);
if (*tmp != '\0')
tmp[strlen(tmp) - 1] = '\0';
return (tmp);
}

1
tmux.h
View File

@@ -1008,6 +1008,7 @@ struct screen {
char *title;
char *path;
struct screen_titles *titles;
u_int ntitles;
struct grid *grid; /* grid data */