termwiz: improve restoring cursor visibility under tmux

refs: <https://github.com/markbt/streampager/issues/37#issuecomment-797241725>
This commit is contained in:
Wez Furlong committed 2021-03-11 22:23:53 -08:00
1 parent 1097f329cf
commit 7c49b43472
1 file changed
+7
+7
View File
@@ -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.
// <https://github.com/markbt/streampager/issues/37#issuecomment-797241725>
if let Some(show) = self.get_capability::<cap::CursorNormal>() {
show.expand().to(out.by_ref())?;
}
if let Some(show) = self.get_capability::<cap::CursorVisible>() {
show.expand().to(out.by_ref())?;
}