Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

color codes break gum filter match foreground #689

Open
DarioDarko opened this issue Oct 17, 2024 · 0 comments
Open

color codes break gum filter match foreground #689

DarioDarko opened this issue Oct 17, 2024 · 0 comments

Comments

@DarioDarko
Copy link

DarioDarko commented Oct 17, 2024

Describe the bug
using escape codes to color text breaks gum filter. typing 'm' 'b' or '[' as first character messes with the color output of match.foreground. disabling match highlighting with --match.foreground="" gets rid of the issue, but highlighting would be nice

this also affects other highlighting styles, i think all of them

i could not reproduce the problem in xterm for some reason, alacritty seems to handle color escape codes differently. not sure about other terminal emulators

To Reproduce

red=$(tput setaf 1)
green=$(tput setaf 2)
reset=$(tput sgr0)

{
	echo "normal text"
	echo "${red}red text${reset}"
	echo "${green}green text${reset}"
} | gum filter

Expected behavior
highlight colored text without breaking the escape code

Screenshots
image

Desktop (please complete the following information):

  • OS: EndeavourOS
  • Terminal: Alacritty
  • Version: gum version 0.14.5 (1917023)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant