Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 22 additions & 8 deletions output.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,11 @@ type parseState struct {
}

func (t *Terminal) handleOutput(buf []byte) []byte {
if t.hasSelectedText() {
t.clearSelectedText()
}
fyne.DoAndWait(func() {
if t.hasSelectedText() {
t.clearSelectedText()
}
})
if t.state == nil {
t.state = &parseState{
esc: noEscape,
Expand Down Expand Up @@ -132,7 +134,11 @@ func (t *Terminal) handleOutput(buf []byte) []byte {
continue
}
if t.state.esc == i-1 {
if cont := t.parseEscState(r); cont {
var cont bool
fyne.DoAndWait(func() {
cont = t.parseEscState(r)
})
if cont {
continue
}
t.state.esc = noEscape
Expand All @@ -150,21 +156,29 @@ func (t *Terminal) handleOutput(buf []byte) []byte {
t.state.vt100 = 0
continue
} else if t.state.esc != noEscape {
t.parseEscape(r)
fyne.DoAndWait(func() {
t.parseEscape(r)
})
continue
}

if out, ok := specialChars[r]; ok {
if out == nil {
continue
}
out(t)
fyne.DoAndWait(func() {
out(t)
})
} else {
// check to see which charset to use
if t.useG1CharSet {
t.handleOutputChar(charSetMap[t.g1Charset](r))
fyne.DoAndWait(func() {
t.handleOutputChar(charSetMap[t.g1Charset](r))
})
} else {
t.handleOutputChar(charSetMap[t.g0Charset](r))
fyne.DoAndWait(func() {
t.handleOutputChar(charSetMap[t.g0Charset](r))
})
}
}
}
Expand Down