aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2021-12-09 16:51:15 -0500
committerJesse Luehrs <doy@tozt.net>2021-12-09 16:51:15 -0500
commitc02cd7278b23ed0423f8c798a939aff05b69039c (patch)
treebd55efc8300de8068cf4f115bad63f4e1c6ec7e1 /src
parentd3250dbffd9bc64efc5592a8e12578b740a84257 (diff)
downloadtextmode-c02cd7278b23ed0423f8c798a939aff05b69039c.tar.gz
textmode-c02cd7278b23ed0423f8c798a939aff05b69039c.zip
add function to hide or show the cursor
Diffstat (limited to 'src')
-rw-r--r--src/lib.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/lib.rs b/src/lib.rs
index 67c0676..6c515c6 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -265,4 +265,13 @@ pub trait Textmode: private::Output {
self.write(b"\x1b[27m");
}
}
+
+ /// Sets whether the cursor should be visible.
+ fn hide_cursor(&mut self, hide: bool) {
+ if hide {
+ self.write(b"\x1b[?25l");
+ } else {
+ self.write(b"\x1b[?25h");
+ }
+ }
}