mirror of
https://github.com/tmate-io/tmate-ssh-server.git
synced 2020-11-18 19:53:51 -08:00
Emulate il1, dl1, ich1 to run (albeit slowly) with vt100 feature set.
This commit is contained in:
parent
094bca5ac3
commit
d31d4c05cf
15
tty-term.c
15
tty-term.c
@ -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");
|
xasprintf(cause, "terminal does not support cud1 or cud");
|
||||||
goto error;
|
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. */
|
/* Figure out if we have 256 or 88 colours. */
|
||||||
if (tty_term_number(term, TTYC_COLORS) == 256)
|
if (tty_term_number(term, TTYC_COLORS) == 256)
|
||||||
|
12
tty.c
12
tty.c
@ -569,12 +569,14 @@ tty_cmd_insertcharacter(struct tty *tty, const struct tty_ctx *ctx)
|
|||||||
if (tty_term_has(tty->term, TTYC_ICH) ||
|
if (tty_term_has(tty->term, TTYC_ICH) ||
|
||||||
tty_term_has(tty->term, TTYC_ICH1))
|
tty_term_has(tty->term, TTYC_ICH1))
|
||||||
tty_emulate_repeat(tty, TTYC_ICH, TTYC_ICH1, ctx->num);
|
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);
|
tty_putcode(tty, TTYC_SMIR);
|
||||||
for (i = 0; i < ctx->num; i++)
|
for (i = 0; i < ctx->num; i++)
|
||||||
tty_putc(tty, ' ');
|
tty_putc(tty, ' ');
|
||||||
tty_putcode(tty, TTYC_RMIR);
|
tty_putcode(tty, TTYC_RMIR);
|
||||||
}
|
} else
|
||||||
|
tty_draw_line(tty, wp->screen, ctx->ocy, wp->xoff, wp->yoff);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@ -606,7 +608,8 @@ tty_cmd_insertline(struct tty *tty, const struct tty_ctx *ctx)
|
|||||||
struct screen *s = wp->screen;
|
struct screen *s = wp->screen;
|
||||||
|
|
||||||
if (wp->xoff != 0 || screen_size_x(s) < tty->sx ||
|
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);
|
tty_redraw_region(tty, ctx);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -626,7 +629,8 @@ tty_cmd_deleteline(struct tty *tty, const struct tty_ctx *ctx)
|
|||||||
struct screen *s = wp->screen;
|
struct screen *s = wp->screen;
|
||||||
|
|
||||||
if (wp->xoff != 0 || screen_size_x(s) < tty->sx ||
|
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);
|
tty_redraw_region(tty, ctx);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user