mirror of
https://github.com/tmux/tmux.git
synced 2024-12-13 01:48:47 +00:00
ECH needs to use background colour.
This commit is contained in:
parent
7d3e2c83d4
commit
886d50dcab
3
input.c
3
input.c
@ -1308,7 +1308,8 @@ input_csi_dispatch(struct input_ctx *ictx)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case INPUT_CSI_ECH:
|
case INPUT_CSI_ECH:
|
||||||
screen_write_clearcharacter(sctx, input_get(ictx, 0, 1, 1));
|
screen_write_clearcharacter(sctx, input_get(ictx, 0, 1, 1),
|
||||||
|
ictx->cell.cell.bg);
|
||||||
break;
|
break;
|
||||||
case INPUT_CSI_DCH:
|
case INPUT_CSI_DCH:
|
||||||
screen_write_deletecharacter(sctx, input_get(ictx, 0, 1, 1),
|
screen_write_deletecharacter(sctx, input_get(ictx, 0, 1, 1),
|
||||||
|
@ -606,7 +606,7 @@ screen_write_deletecharacter(struct screen_write_ctx *ctx, u_int nx, u_int bg)
|
|||||||
|
|
||||||
/* Clear nx characters. */
|
/* Clear nx characters. */
|
||||||
void
|
void
|
||||||
screen_write_clearcharacter(struct screen_write_ctx *ctx, u_int nx)
|
screen_write_clearcharacter(struct screen_write_ctx *ctx, u_int nx, u_int bg)
|
||||||
{
|
{
|
||||||
struct screen *s = ctx->s;
|
struct screen *s = ctx->s;
|
||||||
struct tty_ctx ttyctx;
|
struct tty_ctx ttyctx;
|
||||||
@ -623,6 +623,7 @@ screen_write_clearcharacter(struct screen_write_ctx *ctx, u_int nx)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
screen_write_initctx(ctx, &ttyctx);
|
screen_write_initctx(ctx, &ttyctx);
|
||||||
|
ttyctx.bg = bg;
|
||||||
|
|
||||||
grid_view_clear(s->grid, s->cx, s->cy, nx, 1, 8);
|
grid_view_clear(s->grid, s->cx, s->cy, nx, 1, 8);
|
||||||
|
|
||||||
|
4
tmux.h
4
tmux.h
@ -792,6 +792,7 @@ struct window_pane {
|
|||||||
struct event modetimer;
|
struct event modetimer;
|
||||||
time_t modelast;
|
time_t modelast;
|
||||||
u_int modeprefix;
|
u_int modeprefix;
|
||||||
|
char *searchstr;
|
||||||
|
|
||||||
TAILQ_ENTRY(window_pane) entry;
|
TAILQ_ENTRY(window_pane) entry;
|
||||||
RB_ENTRY(window_pane) tree_entry;
|
RB_ENTRY(window_pane) tree_entry;
|
||||||
@ -1996,7 +1997,7 @@ void screen_write_cursorleft(struct screen_write_ctx *, u_int);
|
|||||||
void screen_write_alignmenttest(struct screen_write_ctx *);
|
void screen_write_alignmenttest(struct screen_write_ctx *);
|
||||||
void screen_write_insertcharacter(struct screen_write_ctx *, u_int, u_int);
|
void screen_write_insertcharacter(struct screen_write_ctx *, u_int, u_int);
|
||||||
void screen_write_deletecharacter(struct screen_write_ctx *, u_int, u_int);
|
void screen_write_deletecharacter(struct screen_write_ctx *, u_int, u_int);
|
||||||
void screen_write_clearcharacter(struct screen_write_ctx *, u_int);
|
void screen_write_clearcharacter(struct screen_write_ctx *, u_int, u_int);
|
||||||
void screen_write_insertline(struct screen_write_ctx *, u_int, u_int);
|
void screen_write_insertline(struct screen_write_ctx *, u_int, u_int);
|
||||||
void screen_write_deleteline(struct screen_write_ctx *, u_int, u_int);
|
void screen_write_deleteline(struct screen_write_ctx *, u_int, u_int);
|
||||||
void screen_write_clearline(struct screen_write_ctx *, u_int);
|
void screen_write_clearline(struct screen_write_ctx *, u_int);
|
||||||
@ -2177,7 +2178,6 @@ void window_copy_vadd(struct window_pane *, const char *, va_list);
|
|||||||
void window_copy_pageup(struct window_pane *, int);
|
void window_copy_pageup(struct window_pane *, int);
|
||||||
void window_copy_start_drag(struct client *, struct mouse_event *);
|
void window_copy_start_drag(struct client *, struct mouse_event *);
|
||||||
int window_copy_scroll_position(struct window_pane *);
|
int window_copy_scroll_position(struct window_pane *);
|
||||||
const char *window_copy_search_string(struct window_pane *);
|
|
||||||
|
|
||||||
/* window-choose.c */
|
/* window-choose.c */
|
||||||
extern const struct window_mode window_choose_mode;
|
extern const struct window_mode window_choose_mode;
|
||||||
|
14
tty.c
14
tty.c
@ -798,6 +798,7 @@ tty_clear_area(struct tty *tty, const struct window_pane *wp, u_int py,
|
|||||||
u_int ny, u_int px, u_int nx, u_int bg)
|
u_int ny, u_int px, u_int nx, u_int bg)
|
||||||
{
|
{
|
||||||
u_int yy;
|
u_int yy;
|
||||||
|
char tmp[64];
|
||||||
|
|
||||||
log_debug("%s: %u,%u at %u,%u", __func__, nx, ny, px, py);
|
log_debug("%s: %u,%u at %u,%u", __func__, nx, ny, px, py);
|
||||||
|
|
||||||
@ -815,6 +816,17 @@ tty_clear_area(struct tty *tty, const struct window_pane *wp, u_int py,
|
|||||||
tty_putcode(tty, TTYC_ED);
|
tty_putcode(tty, TTYC_ED);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* If we're setting a background colour (so it is not default),
|
||||||
|
* we can use DECFRA.
|
||||||
|
*/
|
||||||
|
if (tty->term_type == TTY_VT420 && bg != 8) {
|
||||||
|
xsnprintf(tmp, sizeof tmp, "\033[32;%u;%u;%u;%u$x",
|
||||||
|
py + 1, px + 1, py + ny, px + nx);
|
||||||
|
tty_puts(tty, tmp);
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Couldn't use an escape sequence, loop over the lines. */
|
/* Couldn't use an escape sequence, loop over the lines. */
|
||||||
@ -1023,7 +1035,7 @@ tty_cmd_deletecharacter(struct tty *tty, const struct tty_ctx *ctx)
|
|||||||
void
|
void
|
||||||
tty_cmd_clearcharacter(struct tty *tty, const struct tty_ctx *ctx)
|
tty_cmd_clearcharacter(struct tty *tty, const struct tty_ctx *ctx)
|
||||||
{
|
{
|
||||||
tty_attributes(tty, &grid_default_cell, ctx->wp);
|
tty_default_attributes(tty, ctx->wp, ctx->bg);
|
||||||
|
|
||||||
tty_cursor_pane(tty, ctx, ctx->ocx, ctx->ocy);
|
tty_cursor_pane(tty, ctx, ctx->ocx, ctx->ocy);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user