diff options
author | Thomas Adam <thomas@xteddy.org> | 2020-04-20 17:43:20 +0100 |
---|---|---|
committer | Thomas Adam <thomas@xteddy.org> | 2020-04-20 17:43:20 +0100 |
commit | 32c3fe40ebbc35285c2b0121dfb3dc5623f9fb73 (patch) | |
tree | ff0738166252ad1638a1e5351e1c86a9c08eca39 /tty-term.c | |
parent | c706aadf52f746b695aed34297ad0a910d74eb1b (diff) | |
parent | 4a5182e6658907f876581fbcf4c774bf86d0d953 (diff) | |
download | rtmux-32c3fe40ebbc35285c2b0121dfb3dc5623f9fb73.tar.gz rtmux-32c3fe40ebbc35285c2b0121dfb3dc5623f9fb73.tar.bz2 rtmux-32c3fe40ebbc35285c2b0121dfb3dc5623f9fb73.zip |
Merge branch 'obsd-master'
Diffstat (limited to 'tty-term.c')
-rw-r--r-- | tty-term.c | 41 |
1 files changed, 26 insertions, 15 deletions
@@ -413,6 +413,30 @@ tty_term_apply(struct tty_term *term, const char *capabilities, int quiet) } } +void +tty_term_apply_overrides(struct tty_term *term) +{ + struct options_entry *o; + struct options_array_item *a; + union options_value *ov; + const char *s; + size_t offset; + char *first; + + o = options_get_only(global_options, "terminal-overrides"); + a = options_array_first(o); + while (a != NULL) { + ov = options_array_item_value(a); + s = ov->string; + + offset = 0; + first = tty_term_override_next(s, &offset); + if (first != NULL && fnmatch(first, term->name, 0) == 0) + tty_term_apply(term, s + offset, 0); + a = options_array_next(a); + } +} + struct tty_term * tty_term_create(struct tty *tty, char *name, int *feat, int fd, char **cause) { @@ -504,20 +528,6 @@ tty_term_create(struct tty *tty, char *name, int *feat, int fd, char **cause) a = options_array_next(a); } - /* Apply terminal overrides. */ - o = options_get_only(global_options, "terminal-overrides"); - a = options_array_first(o); - while (a != NULL) { - ov = options_array_item_value(a); - s = ov->string; - - offset = 0; - first = tty_term_override_next(s, &offset); - if (first != NULL && fnmatch(first, term->name, 0) == 0) - tty_term_apply(term, s + offset, 0); - a = options_array_next(a); - } - /* Delete curses data. */ #if !defined(NCURSES_VERSION_MAJOR) || NCURSES_VERSION_MAJOR > 5 || \ (NCURSES_VERSION_MAJOR == 5 && NCURSES_VERSION_MINOR > 6) @@ -550,8 +560,9 @@ tty_term_create(struct tty *tty, char *name, int *feat, int fd, char **cause) if (tty_term_flag(term, TTYC_XT)) tty_add_features(feat, "title", ":,"); - /* Apply the features. */ + /* Apply the features and overrides. */ tty_apply_features(term, *feat); + tty_term_apply_overrides(term); /* * Terminals without xenl (eat newline glitch) wrap at at $COLUMNS - 1 |