diff options
author | Tiago Cunha <tcunha@gmx.com> | 2012-01-21 19:31:59 +0000 |
---|---|---|
committer | Tiago Cunha <tcunha@gmx.com> | 2012-01-21 19:31:59 +0000 |
commit | 4bea5590372e69ac90330281c471cf99e3a8653a (patch) | |
tree | ec52deca56c473534f80011ddc6a48da7a1a3e67 /screen-write.c | |
parent | 674de910ca4c8651d6c9749775e960cb224332f9 (diff) |
Sync OpenBSD patchset 1004:
Add a -R flag to send-keys to reset the terminal. Written ages ago and
Suggested by someone, I forget who.
Diffstat (limited to 'screen-write.c')
-rw-r--r-- | screen-write.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/screen-write.c b/screen-write.c index 7559a773..2f53b04f 100644 --- a/screen-write.c +++ b/screen-write.c @@ -46,6 +46,24 @@ screen_write_stop(unused struct screen_write_ctx *ctx) { } + +/* Reset screen state. */ +void +screen_write_reset(struct screen_write_ctx *ctx) +{ + screen_reset_tabs(ctx->s); + + screen_write_scrollregion(ctx, 0, screen_size_y(ctx->s) - 1); + + screen_write_insertmode(ctx, 0); + screen_write_kcursormode(ctx, 0); + screen_write_kkeypadmode(ctx, 0); + screen_write_mousemode_off(ctx); + + screen_write_clearscreen(ctx); + screen_write_cursormove(ctx, 0, 0); +} + /* Write character. */ void screen_write_putc( |