summaryrefslogtreecommitdiffstats
path: root/usr.bin/tmux/tty.c
diff options
context:
space:
mode:
authornicm <nicm@openbsd.org>2020-05-16 14:22:51 +0000
committernicm <nicm@openbsd.org>2020-05-16 14:22:51 +0000
commit6763df04aa217db104db5cc19f825aa03d376bfc (patch)
tree06973d9e42ab1ec6f7c63af73ecc2dc66d1bb67a /usr.bin/tmux/tty.c
parentResponse is iTerm2 not not ITerm2. (diff)
downloadwireguard-openbsd-6763df04aa217db104db5cc19f825aa03d376bfc.tar.xz
wireguard-openbsd-6763df04aa217db104db5cc19f825aa03d376bfc.zip
Add extension terminfo(5) capabilities for margins.
Diffstat (limited to 'usr.bin/tmux/tty.c')
-rw-r--r--usr.bin/tmux/tty.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/usr.bin/tmux/tty.c b/usr.bin/tmux/tty.c
index f2c60db58e1..b75af45e5b2 100644
--- a/usr.bin/tmux/tty.c
+++ b/usr.bin/tmux/tty.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tty.c,v 1.364 2020/05/16 14:16:25 nicm Exp $ */
+/* $OpenBSD: tty.c,v 1.365 2020/05/16 14:22:51 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -426,7 +426,7 @@ tty_stop_tty(struct tty *tty)
}
if (tty_use_margin(tty))
- tty_raw(tty, "\033[?69l"); /* DECLRMM */
+ tty_raw(tty, tty_term_string(tty->term, TTYC_DSMG));
tty_raw(tty, tty_term_string(tty->term, TTYC_RMCUP));
setblocking(tty->fd, 1);
@@ -473,7 +473,7 @@ tty_update_features(struct tty *tty)
tty_term_apply_overrides(tty->term);
if (tty_use_margin(tty))
- tty_puts(tty, "\033[?69h"); /* DECLRMM */
+ tty_putcode(tty, TTYC_ENMG);
}
void
@@ -2028,7 +2028,7 @@ tty_invalidate(struct tty *tty)
if (tty->flags & TTY_STARTED) {
if (tty_use_margin(tty))
- tty_puts(tty, "\033[?69h"); /* DECLRMM */
+ tty_putcode(tty, TTYC_ENMG);
tty_putcode(tty, TTYC_SGR0);
tty->mode = ALL_MODES;
@@ -2105,8 +2105,6 @@ tty_margin_pane(struct tty *tty, const struct tty_ctx *ctx)
static void
tty_margin(struct tty *tty, u_int rleft, u_int rright)
{
- char s[64];
-
if (!tty_use_margin(tty))
return;
if (tty->rleft == rleft && tty->rright == rright)
@@ -2118,10 +2116,9 @@ tty_margin(struct tty *tty, u_int rleft, u_int rright)
tty->rright = rright;
if (rleft == 0 && rright == tty->sx - 1)
- snprintf(s, sizeof s, "\033[s");
+ tty_putcode(tty, TTYC_CLMG);
else
- snprintf(s, sizeof s, "\033[%u;%us", rleft + 1, rright + 1);
- tty_puts(tty, s);
+ tty_putcode2(tty, TTYC_CMG, rleft, rright);
tty->cx = tty->cy = UINT_MAX;
}