aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobin Jarry <robin@jarry.cc>2023-11-22 23:15:36 +0100
committerRobin Jarry <robin@jarry.cc>2023-11-24 22:44:25 +0100
commiteda71c55d4ccd3b43c2f108de8f9ea9f8382db36 (patch)
treea5d0d86ddeefb0ef67c6a71e493789d386b9a2d8
parent91b26ad93f93743f3222515755d688e5864d61bd (diff)
downloadaerc-eda71c55d4ccd3b43c2f108de8f9ea9f8382db36.tar.gz
term: ensure cursor is hidden before closing
When running a terminal in a dialog that is closed before the terminal has had a chance of being redrawn, the cursor may be left visible. Make sure to hide the cursor in the close routine. Signed-off-by: Robin Jarry <robin@jarry.cc> Tested-by: Bence Ferdinandy <bence@ferdinandy.com> Tested-by: Jason Cox <me@jasoncarloscox.com>
-rw-r--r--app/terminal.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/app/terminal.go b/app/terminal.go
index 85d84db6..f0335de3 100644
--- a/app/terminal.go
+++ b/app/terminal.go
@@ -61,6 +61,9 @@ func (term *Terminal) closeErr(err error) {
// Stop receiving events
term.vterm.Detach()
term.vterm.Close()
+ if term.ctx != nil {
+ term.ctx.HideCursor()
+ }
}
if term.OnClose != nil {
term.OnClose(err)