Last active
October 23, 2024 03:07
-
-
Save rrotter/ecb8fabfb981a92caf1d8a904fbc01ef to your computer and use it in GitHub Desktop.
fix zsh file completion if you're stuck on an unpatched version of zsh 5.9
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
site-functions # diff /usr/share/zsh/5.9/functions/_path_files /usr/local/share/zsh/site-functions/_path_files | |
--- /usr/share/zsh/5.9/functions/_path_files 2024-10-01 00:10:49 | |
+++ XX_path_files 2024-10-19 02:25:56 | |
@@ -145,7 +145,9 @@ | |
if [[ $#matcher -eq 0 && -o nocaseglob ]]; then | |
# If globbing is case insensitive and there's no matcher, | |
# do case-insensitive matching. | |
- matcher=( -M 'm:{a-zA-Z}={A-Za-z}' ) | |
+ # work around bug in zsh 5.9 | |
+ #matcher=( -M 'm:{a-zA-Z}={A-Za-z}' ) | |
+ matcher=( -M 'm:{[:lower:][:upper:]}={[:upper:][:lower:]}' ) | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This code is unchanged in newer versions of zsh. This is a work around for an off-by-1 error in zsh's C code. Most distros have long since backported a fix that is available in the upstream zsh repo, but which isn't yet part of an official release.