summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2009-11-26 14:46:09 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2009-11-26 14:46:09 +0000
commit3ac24027442f927c579e0de8877dae094eecc6df (patch)
treeb35de547010a9edf2074966dfe1cb29f5888747d
parentf85ba28744732fd5ddab334ded1b3bafbb6c951e (diff)
Emulate il1, dl1, ich1 to run (albeit slowly) with vt100 feature set.
-rw-r--r--usr.bin/tmux/tty-term.c17
-rw-r--r--usr.bin/tmux/tty.c14
2 files changed, 10 insertions, 21 deletions
diff --git a/usr.bin/tmux/tty-term.c b/usr.bin/tmux/tty-term.c
index e99c46c8551..553e4c8ee2f 100644
--- a/usr.bin/tmux/tty-term.c
+++ b/usr.bin/tmux/tty-term.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tty-term.c,v 1.14 2009/11/12 08:05:23 nicm Exp $ */
+/* $OpenBSD: tty-term.c,v 1.15 2009/11/26 14:46:08 nicm Exp $ */
/*
* Copyright (c) 2008 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -388,21 +388,6 @@ tty_term_find(char *name, int fd, const char *overrides, char **cause)
xasprintf(cause, "terminal does not support cud1 or cud");
goto error;
}
- if (!tty_term_has(term, TTYC_IL1) && !tty_term_has(term, TTYC_IL)) {
- xasprintf(cause, "terminal does not support il1 or il");
- goto error;
- }
- if (!tty_term_has(term, TTYC_DL1) && !tty_term_has(term, TTYC_DL)) {
- xasprintf(cause, "terminal does not support dl1 or dl");
- goto error;
- }
- if (!tty_term_has(term, TTYC_ICH1) &&
- !tty_term_has(term, TTYC_ICH) && (!tty_term_has(term, TTYC_SMIR) ||
- !tty_term_has(term, TTYC_RMIR))) {
- xasprintf(cause,
- "terminal does not support ich1 or ich or smir and rmir");
- goto error;
- }
/* Figure out if we have 256 or 88 colours. */
if (tty_term_number(term, TTYC_COLORS) == 256)
diff --git a/usr.bin/tmux/tty.c b/usr.bin/tmux/tty.c
index c7dd4bc8fd7..d4feadac19b 100644
--- a/usr.bin/tmux/tty.c
+++ b/usr.bin/tmux/tty.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tty.c,v 1.71 2009/11/18 17:02:17 nicm Exp $ */
+/* $OpenBSD: tty.c,v 1.72 2009/11/26 14:46:08 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -569,12 +569,14 @@ tty_cmd_insertcharacter(struct tty *tty, const struct tty_ctx *ctx)
if (tty_term_has(tty->term, TTYC_ICH) ||
tty_term_has(tty->term, TTYC_ICH1))
tty_emulate_repeat(tty, TTYC_ICH, TTYC_ICH1, ctx->num);
- else {
+ else if (tty_term_has(tty->term, TTYC_SMIR) &&
+ tty_term_has(tty->term, TTYC_RMIR)) {
tty_putcode(tty, TTYC_SMIR);
for (i = 0; i < ctx->num; i++)
tty_putc(tty, ' ');
tty_putcode(tty, TTYC_RMIR);
- }
+ } else
+ tty_draw_line(tty, wp->screen, ctx->ocy, wp->xoff, wp->yoff);
}
void
@@ -606,7 +608,8 @@ tty_cmd_insertline(struct tty *tty, const struct tty_ctx *ctx)
struct screen *s = wp->screen;
if (wp->xoff != 0 || screen_size_x(s) < tty->sx ||
- !tty_term_has(tty->term, TTYC_CSR)) {
+ !tty_term_has(tty->term, TTYC_CSR) ||
+ !tty_term_has(tty->term, TTYC_IL1)) {
tty_redraw_region(tty, ctx);
return;
}
@@ -626,7 +629,8 @@ tty_cmd_deleteline(struct tty *tty, const struct tty_ctx *ctx)
struct screen *s = wp->screen;
if (wp->xoff != 0 || screen_size_x(s) < tty->sx ||
- !tty_term_has(tty->term, TTYC_CSR)) {
+ !tty_term_has(tty->term, TTYC_CSR) ||
+ !tty_term_has(tty->term, TTYC_DL1)) {
tty_redraw_region(tty, ctx);
return;
}