From e59122150932ae2cad32ab5881ed40ef0d722812 Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Thu, 21 Mar 2019 21:34:12 -0400 Subject: Expire status errors on input --- widgets/terminal.go | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'widgets/terminal.go') 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) + } } } -- cgit 1.4.1-2-gfad0