summaryrefslogtreecommitdiffstats
path: root/screen-write.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@openbsd.org>2012-01-21 08:10:21 +0000
committerNicholas Marriott <nicm@openbsd.org>2012-01-21 08:10:21 +0000
commit66f04514cf23a6202ad2dae3cdb96cd0ae74010c (patch)
tree0ad359bb6c1e7c2de568114066fa55bdcfccd10e /screen-write.c
parentcd10f7322a5b33195a8864fa6b7a410387284d16 (diff)
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.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/screen-write.c b/screen-write.c
index d1d02c7c..784f02e2 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(