term: don't mess with cursor when unfocused
This commit is contained in:
parent
960d11c4bc
commit
a602891768
|
@ -297,6 +297,7 @@ func (term *Terminal) Draw(ctx *ui.Context) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if term.focus {
|
||||||
if !term.cursorShown {
|
if !term.cursorShown {
|
||||||
ctx.HideCursor()
|
ctx.HideCursor()
|
||||||
} else {
|
} else {
|
||||||
|
@ -304,10 +305,18 @@ func (term *Terminal) Draw(ctx *ui.Context) {
|
||||||
row, col := state.GetCursorPos()
|
row, col := state.GetCursorPos()
|
||||||
ctx.SetCursor(col, row)
|
ctx.SetCursor(col, row)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (term *Terminal) Focus(focus bool) {
|
func (term *Terminal) Focus(focus bool) {
|
||||||
term.focus = focus
|
term.focus = focus
|
||||||
|
if !term.focus {
|
||||||
|
term.ctx.HideCursor()
|
||||||
|
} else {
|
||||||
|
state := term.vterm.ObtainState()
|
||||||
|
row, col := state.GetCursorPos()
|
||||||
|
term.ctx.SetCursor(col, row)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func convertMods(mods tcell.ModMask) vterm.Modifier {
|
func convertMods(mods tcell.ModMask) vterm.Modifier {
|
||||||
|
|
Loading…
Reference in New Issue