diff options
Diffstat (limited to 'src/terminal.rs')
| -rw-r--r-- | src/terminal.rs | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/terminal.rs b/src/terminal.rs index 300fcfb..d6cfc69 100644 --- a/src/terminal.rs +++ b/src/terminal.rs @@ -74,10 +74,10 @@ impl Terminal { } pub async fn init_full_screen(&mut self) -> Result<()> { - self.do_start_alternate_screen().await?; - self.do_cursor_position(0, 0).await?; + self.start_alternate_screen().await?; + self.set_cursor_position(0, 0).await?; - let (width, height) = self.do_report_size().await?; + let (width, height) = self.report_size().await?; *self.width.write().await = width.try_into().unwrap(); *self.height.write().await = height.try_into().unwrap(); @@ -87,13 +87,13 @@ impl Terminal { } pub async fn zap_full_screen(&mut self) -> Result<()> { - let (width, height) = self.do_report_size().await?; + let (width, height) = self.report_size().await?; *self.width.write().await = width.try_into().unwrap(); *self.height.write().await = height.try_into().unwrap(); self.set_scroll_region(0, height).await?; - self.do_end_alternate_screen().await?; + self.end_alternate_screen().await?; self.stdout.flush().await?; Ok(()) @@ -190,24 +190,24 @@ impl Terminal { } // xterm - pub async fn do_start_alternate_screen(&mut self) -> Result<()> { + pub async fn start_alternate_screen(&mut self) -> Result<()> { self.do_escape(EscapeType::CSIPrivate, "h", &[1049]).await } // xterm - pub async fn do_end_alternate_screen(&mut self) -> Result<()> { + pub async fn end_alternate_screen(&mut self) -> Result<()> { self.do_escape(EscapeType::CSIPrivate, "l", &[1049]).await } // vt220? vt100? - pub async fn do_cursor_position(&mut self, x: usize, y: usize) + pub async fn set_cursor_position(&mut self, x: usize, y: usize) -> Result<()> { self.do_escape(EscapeType::CSI, "H", &[y + 1, x + 1]).await } // dtterm? xterm - pub async fn do_report_size(&mut self) -> Result<(usize, usize)> { + pub async fn report_size(&mut self) -> Result<(usize, usize)> { self.do_escape(EscapeType::CSI, "t", &[18]).await?; self.stdout.flush().await?; let (code, values) = self.read_report(EscapeType::CSI).await?; |