Skip to content

Commit

Permalink
Correct OSC parsing and logging of unrecognised commands
Browse files Browse the repository at this point in the history
  • Loading branch information
andydotxyz committed Mar 4, 2020
1 parent dbad581 commit ec9f1a1
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions osc.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@ package terminal
import "log"

func (t *Terminal) handleOSC(code string) {
if len(code) > 2 && code[1] == ';' {
switch code[0] {
case '0':
t.config.Title = code[2:]
t.onConfigure()
}
} else {
if len(code) <= 2 || code[1] != ';' {
return
}

switch code[0] {
case '0':
t.config.Title = code[2:]
t.onConfigure()
default:
log.Println("Unrecognised OSC:", code)
}
}

0 comments on commit ec9f1a1

Please sign in to comment.