Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tab completion for git add fails on macOS if working directory path contains unicode characters in NFD (decomposed) form #12380

Closed
burnpanck opened this issue Apr 25, 2024 · 2 comments
Labels
Resolution: not our issue Issue or pull request not related to Oh My Zsh

Comments

@burnpanck
Copy link

burnpanck commented Apr 25, 2024

Describe the bug

I may have found an issue with auto-completion for git on macOS (git plugin enabled). I am not sure if this is the right place to report; let me know if not.
If I attempt to tab-complete ongit add within a repo whose path contains unicode characters in NFD (decomposed) form, no completions are presented. With unicode characters in NFC form, everything works as expected. It appears that the macOS Finder application writes folder names in NFD form, whereas on Terminal.app, you have to jump through some hoops to get there.

Steps to reproduce

On macOS, with OMZ installed through homebrew and with the git plugin enabled, try the following:

  • Verify that command completion works normally:
    • mkdir /tmp/test1 && cd /tmp/test1
    • git init
    • touch test.txt
    • Type git add t, then press TAB and see test.txt being suggested
    • Optional: rmdir -r /tmp/test1
  • Repeat with a unicode path in NFD form
    • cd /tmp
    • mkdir $(echo 'u\xcc\x88'). I did not find a better way to create a folder with a unicode character in NFD form. In particular, typing the corresponding key ü on a de_CH keyboard creates that character in NFC form.
    • cd ü/ - here, it doesn't matter which form you use; after all, they are still the same unicode character
    • mkdir test2
    • cd test2
    • git init
    • touch test.txt
    • Type git add t, then press TAB; nothing is being suggested
    • Optional: rmdir -r /tmp/ü/test2

Expected behavior

See above.

Screenshots and recordings

No response

OS / Linux distribution

macOS 14.4.1

Zsh version

5.9

Terminal emulator

Terminal.app

If using WSL on Windows, which version of WSL

None

Additional context

I doubt it matters, but here is the locale anyway:

LC_ALL=de_CH.UTF-8
LANG=en_GB.UTF-8
LC_CTYPE=UTF-8
@carlosala
Copy link
Member

Hi! We do not change git completion; that comes directly from upstream zsh. Even though it seems a bit of a corner case to create a branch/file like that, considering that the OS seems to input NFC form.

@carlosala carlosala closed this as not planned Won't fix, can't repro, duplicate, stale Apr 25, 2024
@carlosala carlosala added the Resolution: not our issue Issue or pull request not related to Oh My Zsh label Apr 25, 2024
@burnpanck
Copy link
Author

burnpanck commented Apr 26, 2024

@carlosala I will therefore re-post at the zsh issue tracker. However, I don't think it's a corner case. The macOS seems to be inconsistent in regard to unicode normalisation. The OS' own graphical interface (Finder.app) creates the files in NFD form, but the OS' own terminal (Terminal.app) uses NFC form, at least with my localisation settings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Resolution: not our issue Issue or pull request not related to Oh My Zsh
Projects
Status: Done
Development

No branches or pull requests

2 participants