mirror of
https://github.com/tmux/tmux.git
synced 2025-01-07 08:18:48 +00:00
Sync OpenBSD patchset 1107:
Pull CRA out into a separate function and add ERA, from Ailin Nemui.
This commit is contained in:
parent
5f92f62ac3
commit
f2f9bc0181
53
tty.c
53
tty.c
@ -44,6 +44,10 @@ void tty_colours_fg(struct tty *, const struct grid_cell *);
|
|||||||
void tty_colours_bg(struct tty *, const struct grid_cell *);
|
void tty_colours_bg(struct tty *, const struct grid_cell *);
|
||||||
|
|
||||||
int tty_large_region(struct tty *, const struct tty_ctx *);
|
int tty_large_region(struct tty *, const struct tty_ctx *);
|
||||||
|
void tty_cra_pane(struct tty *,
|
||||||
|
const struct tty_ctx *, u_int, u_int, u_int, u_int, u_int, u_int);
|
||||||
|
void tty_era_pane(struct tty *,
|
||||||
|
const struct tty_ctx *, u_int, u_int, u_int, u_int);
|
||||||
void tty_redraw_region(struct tty *, const struct tty_ctx *);
|
void tty_redraw_region(struct tty *, const struct tty_ctx *);
|
||||||
void tty_emulate_repeat(
|
void tty_emulate_repeat(
|
||||||
struct tty *, enum tty_code_code, enum tty_code_code, u_int);
|
struct tty *, enum tty_code_code, enum tty_code_code, u_int);
|
||||||
@ -52,6 +56,8 @@ void tty_cell(struct tty *,
|
|||||||
|
|
||||||
#define tty_use_acs(tty) \
|
#define tty_use_acs(tty) \
|
||||||
(tty_term_has(tty->term, TTYC_ACSC) && !((tty)->flags & TTY_UTF8))
|
(tty_term_has(tty->term, TTYC_ACSC) && !((tty)->flags & TTY_UTF8))
|
||||||
|
#define tty_use_rect(tty) \
|
||||||
|
(tty->xterm_version > 270)
|
||||||
|
|
||||||
void
|
void
|
||||||
tty_init(struct tty *tty, int fd, char *term)
|
tty_init(struct tty *tty, int fd, char *term)
|
||||||
@ -689,6 +695,38 @@ tty_write(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
tty_cra_pane(struct tty *tty, const struct tty_ctx *ctx,
|
||||||
|
u_int t, u_int l, u_int b, u_int r, u_int tt, u_int tl)
|
||||||
|
{
|
||||||
|
char tmp[64];
|
||||||
|
|
||||||
|
snprintf(tmp, sizeof tmp,
|
||||||
|
"\033[%u;%u;%u;%u;1;%u;%u;1$v",
|
||||||
|
ctx->yoff + t + 1,
|
||||||
|
ctx->xoff + l + 1,
|
||||||
|
ctx->yoff + b + 1,
|
||||||
|
ctx->xoff + r + 1,
|
||||||
|
ctx->yoff + tt + 1,
|
||||||
|
ctx->xoff + tl + 1);
|
||||||
|
tty_puts(tty, tmp);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
tty_era_pane(struct tty *tty, const struct tty_ctx *ctx,
|
||||||
|
u_int t, u_int l, u_int b, u_int r)
|
||||||
|
{
|
||||||
|
char tmp[64];
|
||||||
|
|
||||||
|
snprintf(tmp, sizeof tmp,
|
||||||
|
"\033[%u;%u;%u;%u$z",
|
||||||
|
ctx->yoff + t + 1,
|
||||||
|
ctx->xoff + l + 1,
|
||||||
|
ctx->yoff + b + 1,
|
||||||
|
ctx->xoff + r + 1);
|
||||||
|
tty_puts(tty, tmp);
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
tty_cmd_insertcharacter(struct tty *tty, const struct tty_ctx *ctx)
|
tty_cmd_insertcharacter(struct tty *tty, const struct tty_ctx *ctx)
|
||||||
{
|
{
|
||||||
@ -868,7 +906,6 @@ tty_cmd_linefeed(struct tty *tty, const struct tty_ctx *ctx)
|
|||||||
{
|
{
|
||||||
struct window_pane *wp = ctx->wp;
|
struct window_pane *wp = ctx->wp;
|
||||||
struct screen *s = wp->screen;
|
struct screen *s = wp->screen;
|
||||||
char tmp[64];
|
|
||||||
|
|
||||||
if (ctx->ocy != ctx->orlower)
|
if (ctx->ocy != ctx->orlower)
|
||||||
return;
|
return;
|
||||||
@ -877,16 +914,10 @@ tty_cmd_linefeed(struct tty *tty, const struct tty_ctx *ctx)
|
|||||||
!tty_term_has(tty->term, TTYC_CSR)) {
|
!tty_term_has(tty->term, TTYC_CSR)) {
|
||||||
if (tty_large_region(tty, ctx))
|
if (tty_large_region(tty, ctx))
|
||||||
wp->flags |= PANE_REDRAW;
|
wp->flags |= PANE_REDRAW;
|
||||||
else if (tty->xterm_version > 270) {
|
else if (tty_use_rect(tty)) {
|
||||||
snprintf(tmp, sizeof tmp,
|
tty_cra_pane (tty, ctx, ctx->orupper + 1, 0,
|
||||||
"\033[%u;%u;%u;%u;1;%u;%u;1$v",
|
ctx->orlower, screen_size_x(s) - 1,
|
||||||
ctx->yoff + ctx->orupper + 2,
|
ctx->orupper, 0);
|
||||||
ctx->xoff + 1,
|
|
||||||
ctx->yoff + ctx->orlower + 1,
|
|
||||||
ctx->xoff + screen_size_x(s),
|
|
||||||
ctx->yoff + ctx->orupper + 1,
|
|
||||||
ctx->xoff + 1);
|
|
||||||
tty_puts(tty, tmp);
|
|
||||||
tty_cmd_clearline(tty, ctx);
|
tty_cmd_clearline(tty, ctx);
|
||||||
} else
|
} else
|
||||||
tty_redraw_region(tty, ctx);
|
tty_redraw_region(tty, ctx);
|
||||||
|
Loading…
Reference in New Issue
Block a user