chrisant996 / clink-fzf

Fzf integration for Clink
MIT License
77 stars 10 forks source link

Double slashes for interior paths in preview window #14

Closed eblis closed 6 months ago

eblis commented 6 months ago

I'm seeing double slashes \\ for all folders inside preview window. I'm not sure if this is happening because of clink-fzf or it's an issue in fzf itself.

It's happening with both dirx and eza.

Dirx

image

Eza

image

chrisant996 commented 6 months ago

Can you share the configuration you're using?

Since the list itself is what fzf receives, and the list looks right, my guess would be that this is an issue in fzf.

And since fzf comes from a nix heritage where to get a single backslash you have to escape the backslash, I wouldn't be surprised if fzf itself is applying some nix-only logic even on Windows.

eblis commented 6 months ago

dirx preview is set FZF_ALT_C_OPTS=--preview-window "right:40%,border-left" --bind "ctrl-/:change-preview-window(right:70%|hidden|)" --preview "dirx -b -s --bare-relative --utf8 --level=3 --icons=always {2..} eza preview is set FZF_ALT_C_OPTS=--preview-window "right:40%,border-left" --bind "ctrl-/:change-preview-window(right:70%|hidden|)" --preview "eza --tree --level=3 --icons=always {2..}

fzf version 0.46.1 (3c0a630), DirX version 0.10, latest clink-gizmos sources and Clink v1.6.5.8f46a4

eblis commented 6 months ago

If full paths are used (like for example dirx --tree which doesn't yet work with relative paths) then the double slashes aren't present. image

chrisant996 commented 6 months ago

I see. You've made a preview command that runs dirx or eza. The preview command is handled by fzf (it's an argument to fzf.exe, so obviously it's handled by fzf.exe).

This is clearly an issue in fzf.exe, and probably only fzf.exe on Windows. It's not related to Clink or DirX or even clink-fzf.

Also, I confirmed that the output from dirx (and eza) only contains single backslashes.

chrisant996 commented 6 months ago

It looks like fzf is doing it right here: https://github.com/junegunn/fzf/blob/1833670fb91dfa17047af320ce7f015e0d500ba6/src/terminal_windows.go#L32

I recommend opening an issue in the fzf repo.