Skip to content

Support ANSI colored and styled underlines #4633

@mklein994

Description

@mklein994

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.67.0 (2ab923f)

OS

  • Linux
  • macOS
  • Windows
  • Etc.

Shell

  • bash
  • zsh
  • fish

Problem / Steps to reproduce

I would like fzf --preview to support rendering colored and styled underlines, as supported by some newer terminal emulators and tools1. Here's an example:

echo -e 'normal\n\x1b[4munderline\x1b[0m\n\x1b[4:2;58:2:255:0:0mred double underline\x1b[0m'

Breaking it down, it will print the word "normal" with the regular style, the word "underline" with an underline, and the phrase "red double underline" with a red double underline, which looks like this (using Ghostty):

Image

If I pass this to fzf --ansi (i.e. echo -e '...' | fzf --ansi), the lines "normal" and "underline" look fine, but the red double underline doesn't show up for the last one:

Image

I'm really after supporting this with --preview, but it's easier for me to give an example with just fzf --ansi.

Footnotes

  1. Ghostty, kitty, Alacritty, and tmux to name a few.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions