summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicholas Marriott <nicholas.marriott@gmail.com>2007-12-06 21:57:57 +0000
committerNicholas Marriott <nicholas.marriott@gmail.com>2007-12-06 21:57:57 +0000
commit21d10e68940743dc6ef1d235b455b00c71540905 (patch)
tree5bd3870ee8884dd1284c47eccce1667eea0eed53
parent9a37eb4d94ab26b2d70ead0f75ff90817c274418 (diff)
Use the current attr/colours for filling in new areas, this fixes the echo \\033[35\;46m\\033[2J bug.
-rw-r--r--TODO40
-rw-r--r--screen-display.c10
-rw-r--r--screen.c11
-rw-r--r--tmux.h4
-rw-r--r--tty.c8
5 files changed, 21 insertions, 52 deletions
diff --git a/TODO b/TODO
index 243851da..cf722dd4 100644
--- a/TODO
+++ b/TODO
@@ -62,48 +62,10 @@
- split clients into three RB trees by fd: attached/unattached/dead?
or tailqs? what would be fastest per-char?
- multiple paste buffers
+- window splitting?
-- For 0.2 --------------------------------------------------------------------
-- window splitting?
- anything which uses cmd_{send,recv}_string will break if the string is
split. string length should be part of the command size
-- echo \\033[35\;46m\\033[2J last line quirk (with C-b r)
- quick intro section (tmux new/attach/detach) etc
- is ACS the right way round??
-
---------
-
-screen redraw.
-
-ops:
-- redraw screen or section of screen to tty without altering it
- (screen-redraw.c, screen_redraw_ctx)
- (switching screen etc)
-- draw to screen and optionally tty
- (window output)
- (screen-write.c, screen_write_ctx)
-- copy line/column from one screen (inc history) at offset??
- (scroll/copy mode)
-
---------
-kmous -- \E[M
-
-mouse init: putp("\033[?1000h");
-mouse deinit: putp("\033[?1000l");
-
-\e[M CbCxCy
- * On button press or release, xterm sends ESC [ M CbCxCy.
- * The low two bits of Cb encode button information: 0=MB1
- * pressed, 1=MB2 pressed, 2=MB3 pressed, 3=release. The
- * upper bits encode what modifiers were down when the
- * button was pressed and are added together. 4=Shift,
- * 8=Meta, 16=Control. Cx and Cy are the x and y coordinates
- * of the mouse event. The upper left corner is (1,1).
-
-
- get_mouse getm Gm Curses should get
- button events
- key_mouse kmous Km Mouse event has
- occurred
- mouse_info minfo Mi Mouse status
- information
diff --git a/screen-display.c b/screen-display.c
index 66cd4e1d..bf85f1e0 100644
--- a/screen-display.c
+++ b/screen-display.c
@@ -1,4 +1,4 @@
-/* $Id: screen-display.c,v 1.12 2007-12-06 10:36:01 nicm Exp $ */
+/* $Id: screen-display.c,v 1.13 2007-12-06 21:57:57 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -378,8 +378,8 @@ screen_display_insert_characters(struct screen *s, u_int px, u_int py, u_int nx)
}
memset(&s->grid_data[py][px], SCREEN_DEFDATA, nx);
- memset(&s->grid_attr[py][px], SCREEN_DEFATTR, nx);
- memset(&s->grid_colr[py][px], SCREEN_DEFCOLR, nx);
+ memset(&s->grid_attr[py][px], s->attr, nx);
+ memset(&s->grid_colr[py][px], s->colr, nx);
}
/* Delete characters. */
@@ -417,8 +417,8 @@ screen_display_delete_characters(struct screen *s, u_int px, u_int py, u_int nx)
}
memset(&s->grid_data[py][screen_size_x(s) - nx], SCREEN_DEFDATA, nx);
- memset(&s->grid_attr[py][screen_size_x(s) - nx], SCREEN_DEFATTR, nx);
- memset(&s->grid_colr[py][screen_size_x(s) - nx], SCREEN_DEFCOLR, nx);
+ memset(&s->grid_attr[py][screen_size_x(s) - nx], s->attr, nx);
+ memset(&s->grid_colr[py][screen_size_x(s) - nx], s->colr, nx);
}
/* Fill cells from another screen, with an offset. */
diff --git a/screen.c b/screen.c
index 051d5ef5..89dd5d63 100644
--- a/screen.c
+++ b/screen.c
@@ -1,4 +1,4 @@
-/* $Id: screen.c,v 1.56 2007-12-06 09:46:23 nicm Exp $ */
+/* $Id: screen.c,v 1.57 2007-12-06 21:57:57 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -299,7 +299,8 @@ screen_set_cell(struct screen *s,
{
if (cx >= s->grid_size[cy]) {
if (data == SCREEN_DEFDATA &&
- attr == SCREEN_DEFATTR && colr == SCREEN_DEFCOLR)
+ attr == SCREEN_DEFATTR &&
+ colr == SCREEN_DEFCOLR)
return;
screen_expand_line(s, cy, cx + 1);
}
@@ -333,6 +334,12 @@ screen_make_lines(struct screen *s, u_int py, u_int ny)
s->grid_colr[i] = NULL;
s->grid_size[i] = 0;
}
+
+ /* XXX should this be done in the callers? */
+ if (s->attr != SCREEN_DEFATTR || s->colr != SCREEN_DEFCOLR) {
+ screen_fill_area(s, 0, py,
+ screen_size_x(s), ny, SCREEN_DEFDATA, s->attr, s->colr);
+ }
}
/* Free a range of ny lines at py. */
diff --git a/tmux.h b/tmux.h
index ac4e2986..e46abdf7 100644
--- a/tmux.h
+++ b/tmux.h
@@ -1,4 +1,4 @@
-/* $Id: tmux.h,v 1.112 2007-12-06 18:28:55 nicm Exp $ */
+/* $Id: tmux.h,v 1.113 2007-12-06 21:57:57 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -454,7 +454,7 @@ struct screen_write_ctx {
/* Screen default contents. */
#define SCREEN_DEFDATA ' '
#define SCREEN_DEFATTR 0
-#define SCREEN_DEFCOLR 0x88
+#define SCREEN_DEFCOLR 0x70 /* white on black */
/* Input parser sequence argument. */
struct input_arg {
diff --git a/tty.c b/tty.c
index aca5ce46..f422b69a 100644
--- a/tty.c
+++ b/tty.c
@@ -1,4 +1,4 @@
-/* $Id: tty.c,v 1.14 2007-12-06 21:26:22 nicm Exp $ */
+/* $Id: tty.c,v 1.15 2007-12-06 21:57:57 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -73,8 +73,8 @@ tty_open(struct tty *tty, char **cause)
tty->in = buffer_create(BUFSIZ);
tty->out = buffer_create(BUFSIZ);
- tty->attr = SCREEN_DEFATTR;
- tty->colr = SCREEN_DEFCOLR;
+ tty->attr = 0;
+ tty->colr = 0x70;
tty_keys_init(tty);
@@ -546,7 +546,7 @@ tty_attributes(struct tty *tty, u_char attr, u_char colr)
exit_alt_charset_mode != NULL)
tty_puts(tty, exit_alt_charset_mode);
tty_puts(tty, exit_attribute_mode);
- tty->colr = 0x88;
+ tty->colr = 0x70;
tty->attr = 0;
}