about summary refs log tree commit diff stats
path: root/widgets/terminal.go
diff options
context:
space:
mode:
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)
+		}
 	}
 }
 
f='/akkartik/mu/blame/counters.mu?h=hlt&id=7990aea904686272fb50bb81cea8f60716901b3a'>^
7d2c2d55 ^
d1c12218 ^


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33