aboutsummaryrefslogtreecommitdiff
path: root/tty.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@openbsd.org>2009-06-03 23:30:40 +0000
committerNicholas Marriott <nicm@openbsd.org>2009-06-03 23:30:40 +0000
commit52ec9b9ec418dbb80e0ebaf8a418eab22e2dd21f (patch)
tree272d4423355ab2387775d1b794546dbde38f41ee /tty.c
parentebe07c27260c295256e7c66480057a3fcfdc9e7f (diff)
downloadrtmux-52ec9b9ec418dbb80e0ebaf8a418eab22e2dd21f.tar.gz
rtmux-52ec9b9ec418dbb80e0ebaf8a418eab22e2dd21f.tar.bz2
rtmux-52ec9b9ec418dbb80e0ebaf8a418eab22e2dd21f.zip
Implement the DEC alignment test. With the last change this is enough for the
first cursor test in vttest (in ports) to pass; it still shops a few more problems though.
Diffstat (limited to 'tty.c')
-rw-r--r--tty.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/tty.c b/tty.c
index 16a865eb..3149c8fb 100644
--- a/tty.c
+++ b/tty.c
@@ -38,6 +38,7 @@ void tty_attributes(struct tty *, const struct grid_cell *);
void tty_attributes_fg(struct tty *, const struct grid_cell *);
void tty_attributes_bg(struct tty *, const struct grid_cell *);
+void tty_cmd_alignmenttest(struct tty *, struct window_pane *, va_list);
void tty_cmd_cell(struct tty *, struct window_pane *, va_list);
void tty_cmd_clearendofline(struct tty *, struct window_pane *, va_list);
void tty_cmd_clearendofscreen(struct tty *, struct window_pane *, va_list);
@@ -54,6 +55,7 @@ void tty_cmd_raw(struct tty *, struct window_pane *, va_list);
void tty_cmd_reverseindex(struct tty *, struct window_pane *, va_list);
void (*tty_cmds[])(struct tty *, struct window_pane *, va_list) = {
+ tty_cmd_alignmenttest,
tty_cmd_cell,
tty_cmd_clearendofline,
tty_cmd_clearendofscreen,
@@ -831,6 +833,24 @@ tty_cmd_clearscreen(
}
void
+tty_cmd_alignmenttest(
+ struct tty *tty, struct window_pane *wp, unused va_list ap)
+{
+ struct screen *s = wp->screen;
+ u_int i, j;
+
+ tty_reset(tty);
+
+ tty_region(tty, 0, screen_size_y(s) - 1, wp->yoff);
+
+ for (j = 0; j < screen_size_y(s); j++) {
+ tty_cursor(tty, 0, j, wp->xoff, wp->yoff);
+ for (i = 0; i < screen_size_x(s); i++)
+ tty_putc(tty, 'E');
+ }
+}
+
+void
tty_cmd_cell(struct tty *tty, struct window_pane *wp, va_list ap)
{
struct screen *s = wp->screen;