about summary refs log tree commit diff stats
path: root/widgets/terminal.go
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2019-03-21 21:34:12 -0400
committerDrew DeVault <sir@cmpwn.com>2019-03-21 21:34:12 -0400
commite59122150932ae2cad32ab5881ed40ef0d722812 (patch)
tree036d3bc807bc6bbad4bda301c6de6d5897f9f976 /widgets/terminal.go
parenta602891768d0272c8688731752f491eb92668d7d (diff)
downloadaerc-e59122150932ae2cad32ab5881ed40ef0d722812.tar.gz
Expire status errors on input
Diffstat (limited to 'widgets/terminal.go')
-rw-r--r--widgets/terminal.go14
1 files changed, 8 insertions, 6 deletions
diff --git a/widgets/terminal.go b/widgets/terminal.go
index 4a339cc..e7286f9 100644
--- a/widgets/terminal.go
+++ b/widgets/terminal.go
@@ -310,12 +310,14 @@ func (term *Terminal) Draw(ctx *ui.Context) {
 
 func (term *Terminal) Focus(focus bool) {
 	term.focus = focus
-	if !term.focus {
-		term.ctx.HideCursor()
-	} else {
-		state := term.vterm.ObtainState()
-		row, col := state.GetCursorPos()
-		term.ctx.SetCursor(col, row)
+	if term.ctx != nil {
+		if !term.focus {
+			term.ctx.HideCursor()
+		} else {
+			state := term.vterm.ObtainState()
+			row, col := state.GetCursorPos()
+			term.ctx.SetCursor(col, row)
+		}
 	}
 }