Merge branch 'obsd-master'

This commit is contained in:
Thomas Adam
2026-06-25 15:30:06 +01:00
2 changed files with 31 additions and 0 deletions

View File

@@ -1477,6 +1477,33 @@ format_cb_client_cell_width(struct format_tree *ft)
return (NULL);
}
/* Callback for client_colours. */
static void *
format_cb_client_colours(struct format_tree *ft)
{
struct tty_term *term;
u_int colours;
if (ft->c == NULL || (~ft->c->tty.flags & TTY_STARTED))
return (NULL);
term = ft->c->tty.term;
if (term->flags & TERM_RGBCOLOURS)
colours = 16777216;
else if (term->flags & TERM_256COLOURS)
colours = 256;
else {
colours = tty_term_number(term, TTYC_COLORS);
if (colours < 8)
colours = 2;
else if (colours < 16)
colours = 8;
else
colours = 16;
}
return (format_printf("%u", colours));
}
/* Callback for client_control_mode. */
static void *
format_cb_client_control_mode(struct format_tree *ft)
@@ -3214,6 +3241,9 @@ static const struct format_table_entry format_table[] = {
{ "client_cell_width", FORMAT_TABLE_STRING,
format_cb_client_cell_width
},
{ "client_colours", FORMAT_TABLE_STRING,
format_cb_client_colours
},
{ "client_control_mode", FORMAT_TABLE_STRING,
format_cb_client_control_mode
},

1
tmux.1
View File

@@ -6715,6 +6715,7 @@ The following variables are available, where appropriate:
.It Li "client_activity" Ta "" Ta "Time client last had activity"
.It Li "client_cell_height" Ta "" Ta "Height of each client cell in pixels"
.It Li "client_cell_width" Ta "" Ta "Width of each client cell in pixels"
.It Li "client_colours" Ta "" Ta "Number of colours client supports"
.It Li "client_control_mode" Ta "" Ta "1 if client is in control mode"
.It Li "client_created" Ta "" Ta "Time client created"
.It Li "client_discarded" Ta "" Ta "Bytes discarded when client behind"