1
1
mirror of https://github.com/wez/wezterm.git synced 2024-11-23 15:04:36 +03:00

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 2019-04-20 20:18:40 +01:00 committed by Wez Furlong
parent 073f9fb1f8
commit 4e783b3920

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 => {