diff options
author | Jesse Luehrs <doy@tozt.net> | 2021-03-07 01:21:07 -0500 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2021-03-07 01:21:07 -0500 |
commit | 341fed83d687c5285dd074d15356e68982822903 (patch) | |
tree | 623024f0978f61978ff0f4e82dce65f698d2ab6a /src/async.rs | |
parent | 8927ec8dafaaca3a14b55bb680b4f7f92fa1ed8b (diff) | |
download | textmode-341fed83d687c5285dd074d15356e68982822903.tar.gz textmode-341fed83d687c5285dd074d15356e68982822903.zip |
simplify, add some more methods
Diffstat (limited to 'src/async.rs')
-rw-r--r-- | src/async.rs | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/async.rs b/src/async.rs index 86f4bdb..5861443 100644 --- a/src/async.rs +++ b/src/async.rs @@ -39,16 +39,14 @@ impl Textmode { let next = vt100::Parser::new(rows, cols, 0); let self_ = Self { cur, next }; - self_ - .write_stdout(b"\x1b7\x1b[?47h\x1b[2J\x1b[H\x1b[?25h") - .await?; + self_.write_stdout(super::INIT).await?; Ok(self_) } // TODO: without async drop or async closures, i'm not sure how to do // better than this pub async fn cleanup(&mut self) -> std::io::Result<()> { - self.write_stdout(b"\x1b[?47l\x1b8\x1b[?25h").await + self.write_stdout(super::DEINIT).await } pub async fn refresh(&mut self) -> std::io::Result<()> { |