summaryrefslogtreecommitdiffstats
path: root/usr.bin/tmux/tty.c
diff options
context:
space:
mode:
authornicm <nicm@openbsd.org>2017-02-07 14:33:37 +0000
committernicm <nicm@openbsd.org>2017-02-07 14:33:37 +0000
commit77faef5a838de2fe9a2ede3267640459f7a9a8f0 (patch)
treed737beb0e4a3b677ec2f3f2957876a94e22b87d0 /usr.bin/tmux/tty.c
parentRemove unused variable in C source to make the test compile and pass. (diff)
downloadwireguard-openbsd-77faef5a838de2fe9a2ede3267640459f7a9a8f0.tar.xz
wireguard-openbsd-77faef5a838de2fe9a2ede3267640459f7a9a8f0.zip
Unfortunately DECFRA does not handle default colours properly (it does
not reset colours when in SGR 0), so we can't use it without more trouble than it is worth. Abandon the idea for now.
Diffstat (limited to 'usr.bin/tmux/tty.c')
-rw-r--r--usr.bin/tmux/tty.c55
1 files changed, 7 insertions, 48 deletions
diff --git a/usr.bin/tmux/tty.c b/usr.bin/tmux/tty.c
index a25049fe8a4..c982cce1355 100644
--- a/usr.bin/tmux/tty.c
+++ b/usr.bin/tmux/tty.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tty.c,v 1.229 2017/02/06 22:05:11 nicm Exp $ */
+/* $OpenBSD: tty.c,v 1.230 2017/02/07 14:33:37 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -64,8 +64,6 @@ static int tty_large_region(struct tty *, const struct tty_ctx *);
static int tty_fake_bce(const struct tty *, const struct window_pane *,
u_int);
static void tty_redraw_region(struct tty *, const struct tty_ctx *);
-static void tty_clear_area(struct tty *, const struct tty_ctx *ctx, u_int,
- u_int, u_int, u_int);
static void tty_emulate_repeat(struct tty *, enum tty_code_code,
enum tty_code_code, u_int);
static void tty_repeat_space(struct tty *, u_int);
@@ -687,17 +685,6 @@ tty_redraw_region(struct tty *tty, const struct tty_ctx *ctx)
}
}
-static void
-tty_clear_area(struct tty *tty, const struct tty_ctx *ctx, u_int sx, u_int sy,
- u_int ex, u_int ey)
-{
- char s[64];
-
- snprintf (s, sizeof s, "\033[32;%u;%u;%u;%u$x", ctx->yoff + sy + 1,
- ctx->xoff + sx + 1, ctx->yoff + ey + 1, ctx->xoff + ex + 1);
- tty_puts(tty, s);
-}
-
void
tty_draw_pane(struct tty *tty, const struct window_pane *wp, u_int py, u_int ox,
u_int oy)
@@ -921,9 +908,6 @@ tty_cmd_clearline(struct tty *tty, const struct tty_ctx *ctx)
!tty_fake_bce(tty, wp, ctx->bg) &&
tty_term_has(tty->term, TTYC_EL))
tty_putcode(tty, TTYC_EL);
- else if (tty->term_type == TTY_VT420 &&
- !tty_fake_bce(tty, wp, ctx->bg))
- tty_clear_area(tty, ctx, 0, ctx->ocy, sx - 1, ctx->ocy);
else
tty_repeat_space(tty, sx);
}
@@ -943,9 +927,6 @@ tty_cmd_clearendofline(struct tty *tty, const struct tty_ctx *ctx)
tty_term_has(tty->term, TTYC_EL) &&
!tty_fake_bce(tty, wp, ctx->bg))
tty_putcode(tty, TTYC_EL);
- else if (tty->term_type == TTY_VT420 &&
- !tty_fake_bce(tty, wp, ctx->bg))
- tty_clear_area(tty, ctx, ctx->ocx, ctx->ocy, sx - 1, ctx->ocy);
else
tty_repeat_space(tty, sx - ctx->ocx);
}
@@ -957,18 +938,14 @@ tty_cmd_clearstartofline(struct tty *tty, const struct tty_ctx *ctx)
tty_default_attributes(tty, wp, ctx->bg);
+ tty_cursor_pane(tty, ctx, 0, ctx->ocy);
+
if (ctx->xoff == 0 &&
tty_term_has(tty->term, TTYC_EL1) &&
- !tty_fake_bce(tty, ctx->wp, ctx->bg)) {
- tty_cursor_pane(tty, ctx, ctx->ocx, ctx->ocy);
+ !tty_fake_bce(tty, ctx->wp, ctx->bg))
tty_putcode(tty, TTYC_EL1);
- } else if (tty->term_type == TTY_VT420 &&
- !tty_fake_bce(tty, wp, ctx->bg))
- tty_clear_area(tty, ctx, 0, ctx->ocy, ctx->ocx, ctx->ocy);
- else {
- tty_cursor_pane(tty, ctx, 0, ctx->ocy);
+ else
tty_repeat_space(tty, ctx->ocx + 1);
- }
}
void
@@ -1059,18 +1036,6 @@ tty_cmd_clearendofscreen(struct tty *tty, const struct tty_ctx *ctx)
tty_term_has(tty->term, TTYC_ED)) {
tty_cursor_pane(tty, ctx, ctx->ocx, ctx->ocy);
tty_putcode(tty, TTYC_ED);
- } else if (tty->term_type == TTY_VT420 &&
- !tty_fake_bce(tty, wp, ctx->bg)) {
- tty_cursor_pane(tty, ctx, ctx->ocx, ctx->ocy);
- if (tty_pane_full_width(tty, ctx) &&
- tty_term_has(tty->term, TTYC_EL))
- tty_putcode(tty, TTYC_EL);
- else
- tty_repeat_space(tty, sx - ctx->ocx);
- if (ctx->ocy != sy - 1) {
- tty_clear_area(tty, ctx, 0, ctx->ocy + 1, sx - 1,
- sy - 1);
- }
} else if (tty_pane_full_width(tty, ctx) &&
tty_term_has(tty->term, TTYC_EL) &&
!tty_fake_bce(tty, wp, ctx->bg)) {
@@ -1109,10 +1074,7 @@ tty_cmd_clearstartofscreen(struct tty *tty, const struct tty_ctx *ctx)
tty_region_pane(tty, ctx, 0, sy - 1);
tty_margin_off(tty);
- if (tty->term_type == TTY_VT420 &&
- !tty_fake_bce(tty, wp, ctx->bg))
- tty_clear_area(tty, ctx, 0, 0, sx - 1, ctx->ocy - 1);
- else if (tty_pane_full_width(tty, ctx) &&
+ if (tty_pane_full_width(tty, ctx) &&
tty_term_has(tty->term, TTYC_EL) &&
!tty_fake_bce(tty, wp, ctx->bg)) {
tty_cursor_pane(tty, ctx, 0, 0);
@@ -1150,10 +1112,7 @@ tty_cmd_clearscreen(struct tty *tty, const struct tty_ctx *ctx)
tty_term_has(tty->term, TTYC_ED)) {
tty_cursor_pane(tty, ctx, 0, 0);
tty_putcode(tty, TTYC_ED);
- } else if (tty->term_type == TTY_VT420 &&
- !tty_fake_bce(tty, wp, ctx->bg))
- tty_clear_area(tty, ctx, 0, 0, sx - 1, sy - 1);
- else if (tty_pane_full_width(tty, ctx) &&
+ } else if (tty_pane_full_width(tty, ctx) &&
tty_term_has(tty->term, TTYC_EL) &&
!tty_fake_bce(tty, wp, ctx->bg)) {
tty_cursor_pane(tty, ctx, 0, 0);