Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'helix-term/src/application.rs')
-rw-r--r--helix-term/src/application.rs18
1 files changed, 16 insertions, 2 deletions
diff --git a/helix-term/src/application.rs b/helix-term/src/application.rs
index 82fdb068..1075730b 100644
--- a/helix-term/src/application.rs
+++ b/helix-term/src/application.rs
@@ -343,7 +343,6 @@ impl Application {
use helix_view::graphics::Rect;
match signal {
signal::SIGTSTP => {
- self.compositor.save_cursor();
self.restore_term().unwrap();
low_level::emulate_default_handler(signal::SIGTSTP).unwrap();
}
@@ -352,7 +351,6 @@ impl Application {
// redraw the terminal
let Rect { width, height, .. } = self.compositor.size();
self.compositor.resize(width, height);
- self.compositor.load_cursor();
self.render();
}
_ => unreachable!(),
@@ -712,7 +710,12 @@ impl Application {
}
async fn claim_term(&mut self) -> Result<(), Error> {
+ use helix_view::graphics::CursorKind;
+ use tui::backend::Backend;
terminal::enable_raw_mode()?;
+ if self.compositor.terminal.cursor_kind() == CursorKind::Hidden {
+ self.compositor.terminal.backend_mut().hide_cursor().ok();
+ }
let mut stdout = stdout();
execute!(stdout, terminal::EnterAlternateScreen)?;
execute!(stdout, terminal::Clear(terminal::ClearType::All))?;
@@ -723,7 +726,18 @@ impl Application {
}
fn restore_term(&mut self) -> Result<(), Error> {
+ use helix_view::graphics::CursorKind;
+ use tui::backend::Backend;
+ if self.compositor.terminal.cursor_kind() == CursorKind::Hidden {
+ self.compositor
+ .terminal
+ .backend_mut()
+ .show_cursor(CursorKind::Block)
+ .ok();
+ }
+
let mut stdout = stdout();
+
// reset cursor shape
write!(stdout, "\x1B[2 q")?;
// Ignore errors on disabling, this might trigger on windows if we call