From 133d546791f32ca7f7d4ce4e6322b84510190963 Mon Sep 17 00:00:00 2001 From: Irene Knapp Date: Fri, 27 Mar 2026 17:32:29 -0700 Subject: rename a bunch of the terminal helpers they had quirky names as a result of being the first things written; they're more consistent now Force-Push: yes Change-Id: I61a1fe9df1d4491c383fb368547a829f5b66c197 --- src/terminal.rs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'src/terminal.rs') 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?; -- cgit 1.4.1