aboutsummaryrefslogtreecommitdiff
path: root/helix-term/src/application.rs
diff options
context:
space:
mode:
authorBlaž Hrastnik2022-03-29 01:01:02 +0000
committerBlaž Hrastnik2022-11-09 12:47:46 +0000
commit00d7b1809714b82f24542f5b9099649e10d5a0b5 (patch)
treed482151d4643760949f882ce7d61717a9c63e6da /helix-term/src/application.rs
parentb2e7171fedd501f2d804f95ed7eaf476d5e352ed (diff)
This term specific behavior really doesn't belong to compositor
Diffstat (limited to 'helix-term/src/application.rs')
-rw-r--r--helix-term/src/application.rs16
1 files changed, 14 insertions, 2 deletions
diff --git a/helix-term/src/application.rs b/helix-term/src/application.rs
index e356c1f9..19eb2e5c 100644
--- a/helix-term/src/application.rs
+++ b/helix-term/src/application.rs
@@ -395,7 +395,6 @@ impl Application {
use helix_view::graphics::Rect;
match signal {
signal::SIGTSTP => {
- self.compositor.save_cursor();
restore_term().unwrap();
low_level::emulate_default_handler(signal::SIGTSTP).unwrap();
}
@@ -404,7 +403,6 @@ impl Application {
// redraw the terminal
let Rect { width, height, .. } = self.compositor.size();
self.compositor.resize(width, height);
- self.compositor.load_cursor();
self.render();
}
signal::SIGUSR1 => {
@@ -924,7 +922,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,
@@ -958,6 +961,15 @@ impl Application {
self.event_loop(input_stream).await;
let close_errs = self.close().await;
+
+ use helix_view::graphics::CursorKind;
+ use tui::backend::Backend;
+ self.compositor
+ .terminal
+ .backend_mut()
+ .show_cursor(CursorKind::Block)
+ .ok();
+
restore_term()?;
for err in close_errs {