Skip to content

Commit

Permalink
Fix OSC 8 parser
Browse files Browse the repository at this point in the history
  • Loading branch information
junegunn committed Aug 14, 2024
1 parent d90a969 commit 581734c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/ansi.go
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ func interpretCode(ansiCode string, prevState *ansiState) ansiState {
if ansiCode[0] != '\x1b' || ansiCode[1] != '[' || ansiCode[len(ansiCode)-1] != 'm' {
if prevState != nil && strings.HasSuffix(ansiCode, "0K") {
state.lbg = prevState.bg
} else if ansiCode == "\x1b]8;;\x1b" { // End of a hyperlink
} else if ansiCode == "\x1b]8;;\x1b\\" { // End of a hyperlink
state.url = nil
} else if strings.HasPrefix(ansiCode, "\x1b]8;") && strings.HasSuffix(ansiCode, "\x1b\\") {
if paramsEnd := strings.IndexRune(ansiCode[4:], ';'); paramsEnd >= 0 {
Expand Down

0 comments on commit 581734c

Please sign in to comment.