Skip to content

fzf mangles OSC8 hyperlinks if the path contains unicode #4707

@jathek

Description

@jathek

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.70.0 (eacef5e)

OS

  • Linux
  • macOS
  • Windows
  • Etc.

Shell

  • bash
  • zsh
  • fish

Problem / Steps to reproduce

terminal: Windows Terminal 1.24.2682.0 (but it's a Linux system that I am ssh-ing to)
shell: zsh 5.9 (x86_64-slackware-linux-gnu)

I have a script that outputs OSC8 hyperlinks to files, allowing me to open them directly from the terminal. Occasionally, the file paths will include Unicode characters. These OSC8 hyperlinks work fine in the terminal but are mangled when in fzf.

Test cases

These are the simplest commands I could make to demonstrate different use cases. The existence of the files themselves is unnecessary. As you can see, the only time Unicode is an issue is if the file path contains the Unicode. Unicode in the link text is irrelevant.

working in terminal:

printf '\e]8;;%s\e\\%s\e]8;;\e\\\n' /root/anime.txt anime.txt /root/アニメ.txt anime-but-unicode-path.txt /root/anime.txt unicode-only-in-link-text-📺.txt /root/アニメ.txt アニメ.txt
Image

ASCII links work in fzf, but links with Unicode paths are mangled:

fzf < <(printf '\e]8;;%s\e\\%s\e]8;;\e\\\n' /root/anime.txt anime.txt /root/アニメ.txt anime-but-unicode-path.txt /root/anime.txt unicode-only-in-link-text-📺.txt /root/アニメ.txt アニメ.txt)
Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions