mirror of
https://github.com/junegunn/fzf.git
synced 2025-07-31 20:22:01 -07:00
Fix #162 - Ignore \e[K
This commit is contained in:
@@ -33,7 +33,7 @@ func (s *ansiState) equals(t *ansiState) bool {
|
||||
var ansiRegex *regexp.Regexp
|
||||
|
||||
func init() {
|
||||
ansiRegex = regexp.MustCompile("\x1b\\[[0-9;]*m")
|
||||
ansiRegex = regexp.MustCompile("\x1b\\[[0-9;]*[mK]")
|
||||
}
|
||||
|
||||
func extractColor(str *string) (*string, []ansiOffset) {
|
||||
@@ -87,6 +87,9 @@ func interpretCode(ansiCode string, prevState *ansiState) *ansiState {
|
||||
} else {
|
||||
state = &ansiState{prevState.fg, prevState.bg, prevState.bold}
|
||||
}
|
||||
if ansiCode[len(ansiCode)-1] == 'K' {
|
||||
return state
|
||||
}
|
||||
|
||||
ptr := &state.fg
|
||||
state256 := 0
|
||||
|
Reference in New Issue
Block a user