Move the UTF-8 flag to terminal flags.

pull/2172/head
nicm 2020-04-16 14:25:35 +00:00
parent 4744aa43af
commit 5ec80bd249
5 changed files with 6 additions and 5 deletions

View File

@ -2569,7 +2569,7 @@ format_defaults_client(struct format_tree *ft, struct client *c)
format_add(ft, "client_prefix", "%d", 1);
format_add(ft, "client_key_table", "%s", c->keytable->name);
if (tty->flags & TTY_UTF8)
if (tty_get_flags(tty) & TERM_UTF8)
format_add(ft, "client_utf8", "%d", 1);
else
format_add(ft, "client_utf8", "%d", 0);

View File

@ -2056,7 +2056,7 @@ server_client_dispatch_identify(struct client *c, struct imsg *imsg)
c->fd = -1;
} else {
if (c->flags & CLIENT_UTF8)
c->tty.flags |= TTY_UTF8;
c->tty.term_flags |= TERM_UTF8;
if (c->flags & CLIENT_256COLOURS)
c->tty.term_flags |= TERM_256COLOURS;
tty_resize(&c->tty);

3
tmux.h
View File

@ -1183,6 +1183,7 @@ struct tty_term {
#define TERM_DECFRA 0x8
#define TERM_RGBCOLOURS 0x10
#define TERM_SYNC 0x20
#define TERM_UTF8 0x40
int flags;
LIST_ENTRY(tty_term) entry;
@ -1235,7 +1236,7 @@ struct tty {
#define TTY_NOCURSOR 0x1
#define TTY_FREEZE 0x2
#define TTY_TIMER 0x4
#define TTY_UTF8 0x8
/* 0x8 unused */
#define TTY_STARTED 0x10
#define TTY_OPENED 0x20
#define TTY_FOCUS 0x40

View File

@ -99,7 +99,7 @@ tty_acs_needed(struct tty *tty)
tty_term_number(tty->term, TTYC_U8) == 0)
return (1);
if (tty->flags & TTY_UTF8)
if (tty_get_flags(tty) & TERM_UTF8)
return (0);
return (1);
}

2
tty.c
View File

@ -1255,7 +1255,7 @@ tty_check_codeset(struct tty *tty, const struct grid_cell *gc)
return (gc);
/* UTF-8 terminal and a UTF-8 character - fine. */
if (tty->flags & TTY_UTF8)
if (tty_get_flags(tty) & TERM_UTF8)
return (gc);
/* Replace by the right number of underscores. */