From 7c49b43472f31f33676b422dab46b8db232d6341 Mon Sep 17 00:00:00 2001 From: Wez Furlong Date: Thu, 11 Mar 2021 22:23:53 -0800 Subject: [PATCH] termwiz: improve restoring cursor visibility under tmux refs: --- termwiz/src/render/terminfo.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/termwiz/src/render/terminfo.rs b/termwiz/src/render/terminfo.rs index 4edf27113..e984ae8b5 100644 --- a/termwiz/src/render/terminfo.rs +++ b/termwiz/src/render/terminfo.rs @@ -541,6 +541,13 @@ impl TerminfoRenderer { }, Change::CursorVisibility(visibility) => match visibility { CursorVisibility::Visible => { + // tmux doesn't transition from hidden->visible with just visible + // when using `TERM=screen`. The recommendation is to also set + // the cursor back to normal, so that's what we do. + // + if let Some(show) = self.get_capability::() { + show.expand().to(out.by_ref())?; + } if let Some(show) = self.get_capability::() { show.expand().to(out.by_ref())?; }