summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn Hawthorn <john@hawthorn.email>2018-09-09 12:53:08 -0700
committerJohn Hawthorn <john@hawthorn.email>2018-09-09 13:08:49 -0700
commit42e9ffd27db2c9634ddc8f82cd736a2caa6728cc (patch)
treeaf437e8fcaa68ce1baaf84d453dc42431c958741 /src
parent03ccaaf3392712370274df5d39ec9cfad9ef39c2 (diff)
Add sequence to disable line wrap
Diffstat (limited to 'src')
-rw-r--r--src/tty.c8
-rw-r--r--src/tty.h2
2 files changed, 10 insertions, 0 deletions
diff --git a/src/tty.c b/src/tty.c
index 7271307..a8f014e 100644
--- a/src/tty.c
+++ b/src/tty.c
@@ -119,6 +119,14 @@ void tty_setnormal(tty_t *tty) {
tty->fgcolor = 9;
}
+void tty_setnowrap(tty_t *tty) {
+ tty_printf(tty, "%c%c?7l", 0x1b, '[');
+}
+
+void tty_setwrap(tty_t *tty) {
+ tty_printf(tty, "%c%c?7h", 0x1b, '[');
+}
+
void tty_newline(tty_t *tty) {
tty_printf(tty, "%c%cK\n", 0x1b, '[');
}
diff --git a/src/tty.h b/src/tty.h
index b949a46..e7672b6 100644
--- a/src/tty.h
+++ b/src/tty.h
@@ -23,6 +23,8 @@ void tty_setfg(tty_t *tty, int fg);
void tty_setinvert(tty_t *tty);
void tty_setunderline(tty_t *tty);
void tty_setnormal(tty_t *tty);
+void tty_setnowrap(tty_t *tty);
+void tty_setwrap(tty_t *tty);
#define TTY_COLOR_BLACK 0
#define TTY_COLOR_RED 1