diff options
author | Nicholas Marriott <nicm@cvs.openbsd.org> | 2009-06-03 23:30:41 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@cvs.openbsd.org> | 2009-06-03 23:30:41 +0000 |
commit | c343c54e7e06f65e055482dd38bf60a1af95f807 (patch) | |
tree | 72b1d2684b86e746c1ec5874aff33f4bab433180 /usr.bin/tmux/tty.c | |
parent | 1a98409cc428d08343951a211c5ab412792a09bf (diff) |
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 'usr.bin/tmux/tty.c')
-rw-r--r-- | usr.bin/tmux/tty.c | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/usr.bin/tmux/tty.c b/usr.bin/tmux/tty.c index 834ef713026..8f1bb963b3b 100644 --- a/usr.bin/tmux/tty.c +++ b/usr.bin/tmux/tty.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tty.c,v 1.3 2009/06/03 23:26:56 nicm Exp $ */ +/* $OpenBSD: tty.c,v 1.4 2009/06/03 23:30:40 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -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; |