make cursor visible when setting shape to default

If the cursor has been made invisible (by setting the shape to `Hidden`),
then in order for it to be visible when it is reset to the default shape,
it must be made visible.  This can be done by rendering the `CursorVisible`
sequence.

Where supported, the `CursorNormal` sequence can be rendered to do
both `CursorVisible` and `ResetCursorStyle` in one go.
This commit is contained in:
Mark Thomas authored and Wez Furlong committed 2019-05-18 09:12:46 -07:00
1 parent 073f9fb1f8
commit 4e783b3920
1 file changed
+9 -2
+9 -2
View File
@@ -524,8 +524,15 @@ impl TerminfoRenderer {
}
Change::CursorShape(shape) => match shape {
CursorShape::Default => {
if let Some(reset) = self.get_capability::<cap::ResetCursorStyle>() {
reset.expand().to(out.by_ref())?;
if let Some(normal) = self.get_capability::<cap::CursorNormal>() {
normal.expand().to(out.by_ref())?;
} else {
if let Some(show) = self.get_capability::<cap::CursorVisible>() {
show.expand().to(out.by_ref())?;
}
if let Some(reset) = self.get_capability::<cap::ResetCursorStyle>() {
reset.expand().to(out.by_ref())?;
}
}
}
CursorShape::Hidden => {