diff options
author | Jesse Luehrs <doy@tozt.net> | 2021-12-09 16:51:15 -0500 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2021-12-09 16:51:15 -0500 |
commit | c02cd7278b23ed0423f8c798a939aff05b69039c (patch) | |
tree | bd55efc8300de8068cf4f115bad63f4e1c6ec7e1 /src | |
parent | d3250dbffd9bc64efc5592a8e12578b740a84257 (diff) | |
download | textmode-c02cd7278b23ed0423f8c798a939aff05b69039c.tar.gz textmode-c02cd7278b23ed0423f8c798a939aff05b69039c.zip |
add function to hide or show the cursor
Diffstat (limited to 'src')
-rw-r--r-- | src/lib.rs | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -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"); + } + } } |