Nuke CLEAR_SCREEN/ENDOFSCREEN and assert scroll region when drawing. These will be reqd for status line(s).

pull/1/head
Nicholas Marriott 2007-09-29 10:57:39 +00:00
parent 2ec60c9d66
commit a777c060dc
4 changed files with 24 additions and 26 deletions

18
input.c
View File

@ -1,4 +1,4 @@
/* $Id: input.c,v 1.9 2007-09-29 09:50:59 nicm Exp $ */
/* $Id: input.c,v 1.10 2007-09-29 10:57:39 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@ -764,6 +764,7 @@ void
input_handle_sequence_ed(struct input_ctx *ictx)
{
uint16_t n;
u_int i;
if (ictx->private != '\0')
return;
@ -780,12 +781,21 @@ input_handle_sequence_ed(struct input_ctx *ictx)
case 0:
screen_fill_end_of_screen(ictx->s, ictx->s->cx, ictx->s->cy,
SCREEN_DEFDATA, ictx->s->attr, ictx->s->colr);
input_store_zero(ictx->b, CODE_CLEARENDOFSCREEN);
for (i = ictx->s->cy; i < ictx->s->sy; i++) {
input_store_zero(ictx->b, CODE_CLEARLINE);
input_store_two(ictx->b, CODE_CURSORMOVE, i + 1, 1);
}
input_store_two(
ictx->b, CODE_CURSORMOVE, ictx->s->cy + 1, ictx->s->cx + 1);
break;
case 2:
screen_fill_screen(
ictx->s, SCREEN_DEFDATA, ictx->s->attr, ictx->s->colr);
input_store_zero(ictx->b, CODE_CLEARSCREEN);
for (i = 0; i < ictx->s->sy; i++) {
input_store_two(ictx->b, CODE_CURSORMOVE, i + 1, 1);
input_store_zero(ictx->b, CODE_CLEARLINE);
}
input_store_two(ictx->b, CODE_CURSORMOVE, 1, 1);
break;
}
}
@ -920,7 +930,7 @@ input_handle_sequence_decstbm(struct input_ctx *ictx)
if (input_get_argument(ictx, 1, &m, 1) != 0)
return;
if (n == 0 || n > ictx->s->sy - 1 || m == 0 || m > ictx->s->sx - 1) {
if (n == 0 || n > ictx->s->sy || m == 0 || m > ictx->s->sx) {
log_debug3("decstbm: out of range: %hu,%hu", m, n);
return;
}

16
local.c
View File

@ -1,4 +1,4 @@
/* $Id: local.c,v 1.9 2007-09-29 09:53:25 nicm Exp $ */
/* $Id: local.c,v 1.10 2007-09-29 10:57:39 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@ -477,20 +477,6 @@ local_output(struct buffer *b, size_t size)
}
local_putp(tparm(cursor_address, ua - 1, ub - 1));
break;
case CODE_CLEARENDOFSCREEN:
if (clr_eos == NULL) {
log_warnx("clr_eos not supported");
break;
}
local_putp(clr_eos);
break;
case CODE_CLEARSCREEN:
if (clear_screen == NULL) {
log_warnx("clear_screen not supported");
break;
}
local_putp(clear_screen);
break;
case CODE_CLEARENDOFLINE:
if (clr_eol == NULL) {
log_warnx("clr_eol not supported");

View File

@ -1,4 +1,4 @@
/* $Id: screen.c,v 1.12 2007-09-28 22:47:21 nicm Exp $ */
/* $Id: screen.c,v 1.13 2007-09-29 10:57:39 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@ -28,8 +28,6 @@
* XXX Much of this file sucks.
*/
size_t screen_store_attributes(struct buffer *, u_char);
size_t screen_store_colours(struct buffer *, u_char);
void screen_free_lines(struct screen *, u_int, u_int);
void screen_make_lines(struct screen *, u_int, u_int);
void screen_move_lines(struct screen *, u_int, u_int, u_int);
@ -175,6 +173,8 @@ screen_draw(struct screen *s, struct buffer *b, u_int uy, u_int ly)
attr = 0;
colr = SCREEN_DEFCOLR;
input_store_two(b, CODE_SCROLLREGION, 1, s->sy);
input_store_zero(b, CODE_CURSOROFF);
input_store_one(b, CODE_ATTRIBUTES, 0);
@ -192,7 +192,7 @@ screen_draw(struct screen *s, struct buffer *b, u_int uy, u_int ly)
attr = s->grid_attr[j][i];
n += screen_store_attributes(b, attr);
if (attr == 0)
colr = SCREEN_DEFCOLR;
colr = SCREEN_DEFCOLR;
}
if (s->grid_colr[j][i] != colr) {
colr = s->grid_colr[j][i];

8
tmux.h
View File

@ -1,4 +1,4 @@
/* $Id: tmux.h,v 1.23 2007-09-29 09:53:25 nicm Exp $ */
/* $Id: tmux.h,v 1.24 2007-09-29 10:57:39 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@ -238,9 +238,9 @@ struct buffer {
#define CODE_INSERTLINE 6
#define CODE_DELETELINE 7
#define CODE_CLEARLINE 8
#define CODE_CLEARSCREEN 9
/* 9 unused */
#define CODE_CLEARENDOFLINE 10
#define CODE_CLEARENDOFSCREEN 11
/* 11 unused */
#define CODE_CLEARSTARTOFLINE 12
#define CODE_CURSORMOVE 13
#define CODE_ATTRIBUTES 14
@ -568,6 +568,8 @@ void input_translate_key(struct buffer *, int);
void screen_create(struct screen *, u_int, u_int);
void screen_resize(struct screen *, u_int, u_int);
void screen_draw(struct screen *, struct buffer *, u_int, u_int);
size_t screen_store_attributes(struct buffer *, u_char);
size_t screen_store_colours(struct buffer *, u_char);
void screen_write_character(struct screen *, u_char);
void screen_insert_lines(struct screen *, u_int, u_int);
void screen_delete_lines(struct screen *, u_int, u_int);