-
-
Notifications
You must be signed in to change notification settings - Fork 774
Description
Description
I think all fish completions are now broken on MacOS. Here's a reproducer, which Claude helped me write, and a link to the PR that I think created these changes.
What did you do?
Ran task <TAB> in fish shell on macOS to get task completions.
What did you expect to happen?
$ task <TAB>
clean (Reset environment to declared dependencies.)
What happened instead?
$ task <TAB>
* clean: Reset environment to declared dependencies. (Runs the specified task(s)...
* ```
Task names appear with raw formatting instead of clean completions.
**Cause:**
The `__task_get_tasks` function in `completion/fish/task.fish` uses:
```fish
sed -e '1d; s/\* \(.*\):\s\{2,\}\(.*\)\s\{2,\}(\(aliases.*\))/\1\t\2\t\3/' -e 's/\* \(.*\):\s\{2,\}\(.*\)/\1\t\2/'
The \s escape sequence (whitespace) is a GNU sed extension. BSD sed (macOS default) doesn't support it, so the pattern silently fails to match and passes through raw output.
Fix:
Replace \s\{2,\} with POSIX-compatible [[:space:]][[:space:]]* or simply * (two literal spaces followed by asterisk):
sed -e '1d; s/\* \(.*\): *\(.*\) *(\(aliases.*\))/\1\t\2\t\3/' -e 's/\* \(.*\): *\(.*\)/\1\t\2/'Tested on macOS 15.2 with BSD sed — the POSIX pattern correctly extracts task names and descriptions.
Note: Previous versions (before v3.46.1) used sed 's/: /\t/g' which was POSIX-compatible. The regression was introduced when PR #2532 rewrote the completion script.
Version
3.46.3 (introduced in v3.46.1)
Operating system
macOS 15.2 (Sequoia) with BSD sed
Experiments Enabled
No response