cursor fixed

This commit is contained in:
filipriec
2025-04-07 23:39:27 +02:00
parent 75cd942f39
commit a8eef8107b
4 changed files with 25 additions and 10 deletions

View File

@@ -3,7 +3,7 @@
use crossterm::{
execute,
terminal::{disable_raw_mode, enable_raw_mode, EnterAlternateScreen, LeaveAlternateScreen},
cursor::{SetCursorStyle, EnableBlinking, Show, MoveTo},
cursor::{SetCursorStyle, EnableBlinking, Show, Hide, MoveTo},
};
use ratatui::{backend::CrosstermBackend, Terminal};
use std::io::{self, stdout, Write};
@@ -72,6 +72,14 @@ impl TerminalCore {
)?;
Ok(())
}
pub fn hide_cursor(&mut self) -> Result<(), Box<dyn std::error::Error>> {
execute!(
self.terminal.backend_mut(),
Hide
)?;
Ok(())
}
}
impl Drop for TerminalCore {