diff options
Diffstat (limited to 'usr.bin/tmux/tty-features.c')
-rw-r--r-- | usr.bin/tmux/tty-features.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/usr.bin/tmux/tty-features.c b/usr.bin/tmux/tty-features.c index 6fa18b22d8e..78ea81c9706 100644 --- a/usr.bin/tmux/tty-features.c +++ b/usr.bin/tmux/tty-features.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tty-features.c,v 1.2 2020/04/20 13:38:48 nicm Exp $ */ +/* $OpenBSD: tty-features.c,v 1.3 2020/04/20 15:37:32 nicm Exp $ */ /* * Copyright (c) 2020 Nicholas Marriott <nicholas.marriott@gmail.com> @@ -232,7 +232,7 @@ tty_get_features(int feat) return (s); } -void +int tty_apply_features(struct tty_term *term, int feat) { const struct tty_feature *tf; @@ -240,7 +240,7 @@ tty_apply_features(struct tty_term *term, int feat) u_int i; if (feat == 0) - return; + return (0); log_debug("applying terminal features: %s", tty_get_features(feat)); for (i = 0; i < nitems(tty_features); i++) { @@ -259,5 +259,8 @@ tty_apply_features(struct tty_term *term, int feat) } term->flags |= tf->flags; } + if ((term->features | feat) == term->features) + return (0); term->features |= feat; + return (1); } |