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

Preserve color output of kubecolor get pods -A | fzf --ansi? #3782

Closed
5 of 10 tasks
tmpm697 opened this issue May 8, 2024 · 1 comment
Closed
5 of 10 tasks

Preserve color output of kubecolor get pods -A | fzf --ansi? #3782

tmpm697 opened this issue May 8, 2024 · 1 comment

Comments

@tmpm697
Copy link

tmpm697 commented May 8, 2024

Checklist

  • I have read through the manual page (man fzf)
  • I have searched through the existing issues
  • For bug reports, I have checked if the bug is reproducible in the latest version of fzf

Output of fzf --version

0.51.0

OS

  • Linux
  • macOS
  • Windows
  • Etc.

Shell

  • bash
  • zsh
  • fish

Problem / Steps to reproduce

I have this:

kubecolor get pods -A | fzf --ansi

expect color output of kubecolor preserved but in fact, the color is lost.

@LangLangBart
Copy link
Contributor

LangLangBart commented May 8, 2024

Usually, there is an extra option to retain the escape sequences when piped into another command.

See: kubecolor/kubecolor - Dynamic tty support

KUBECOLOR_FORCE_COLORS=true kubecolor ... | fzf ...
# or
kubecolor --force-colors ... | fzf ...
# Enables colors automatically when outputting to the terminal; otherwise, it disables them.
command grep --color=auto '^foo' /usr/share/dict/words
command grep --color=auto '^foo' /usr/share/dict/words | fzf

# vs

# Always enables colorized output.
command grep --color=always '^foo' /usr/share/dict/words | fzf

@tmpm697 tmpm697 closed this as completed May 8, 2024
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

2 participants