Skip to content

Unify realpath/readlink -f/pwd on the shell display spelling (niubash#993 §7) #1783

Closed

Description

@caomengxuan666

From the niubash#993 Git-Bash drop-in audit, §7: the three path emitters print three different spellings for the same file — realpath gives C:\tmp\... (backslashes), readlink -f gives C:/tmp/... (forward-slash drive form), and the shell's pwd gives /c/tmp/... (MSYS form). readlink of a relative symlink target prints the stored Win32 spelling d\f where Git Bash shows d/f.

Git Bash prints the /c/... form for all of them.

Scope: realpath (all canon modes), readlink -f/-e/-m, readlink verbatim targets, and pwd share one display spelling — the shell mount name (/tmp, /usr/..., /) under a configured shell root, else the /c/ drive form. Backslash output is unsafe to feed into regex/glob consumers and [[ $(realpath x) == /c/* ]] can never match.

Activity

  1. added
    bug
    compat-gap
    on Nov 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bugcompat-gap

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions