mirror of
https://github.com/junegunn/fzf.git
synced 2025-08-27 18:33:49 -07:00
Sanitize input strings that should be a single line
This commit is contained in:
@@ -731,6 +731,7 @@ func (t *Terminal) ansiLabelPrinter(str string, color *tui.ColorPair, fill bool)
|
||||
}
|
||||
|
||||
// Extract ANSI color codes
|
||||
str = firstLine(str)
|
||||
text, colors, _ := extractColor(str, nil, nil)
|
||||
runes := []rune(text)
|
||||
|
||||
@@ -785,6 +786,7 @@ func (t *Terminal) ansiLabelPrinter(str string, color *tui.ColorPair, fill bool)
|
||||
|
||||
func (t *Terminal) parsePrompt(prompt string) (func(), int) {
|
||||
var state *ansiState
|
||||
prompt = firstLine(prompt)
|
||||
trimmed, colors, _ := extractColor(prompt, state, nil)
|
||||
item := &Item{text: util.ToChars([]byte(trimmed)), colors: colors}
|
||||
|
||||
|
Reference in New Issue
Block a user