Skip to content

os.PathSeparator is different from actual path separator in MSYS2 shell #4281

@jboekesteijn

Description

@jboekesteijn

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.60.2 (c0d407f)

OS

  • Linux
  • macOS
  • Windows
  • Etc.

Shell

  • bash
  • zsh
  • fish

Problem / Steps to reproduce

Since the changes in 6fa8295 the os.PathSeparator is appended to path completions as a suffix, but this is different from the actual path separator under MSYS2 shell on Windows:

/c> `__fzf_cd__`
> msys64/usr/lib
  346/131630 ───────────────────────────────────────────────────────
▌ msys64/usr/lib\
  msys64/usr/libexec\
  msys64/usr/lib/tar\
  msys64/usr/lib/ssh\
  msys64/usr/lib/awk\
...

Notice the \ (Windows-style) at the end while / (UNIX-style) is used for intermediate steps.

I believe a special case should be added when the MSYSTEM environment variable is set to override the os.PathSeparator and use / instead for consistency.

Please also see:

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions