Skip to content

Conversation

@vmaerten
Copy link
Member

Summary

fixes #2101

Fix Fish shell completion breaking when task descriptions contain colons followed by text (e.g., shiny::runApp() or URLs like https://example.com).

Before: Tab completion showed garbled output like task run:\ \ \ \ \ \ \ Run\ the\ app\ with\ shiny:

After: Completion works correctly, preserving the full description.

Root Cause

The sed pattern in completion/fish/task.fish used :\s* (colon + zero or more spaces), causing the greedy .* to match up to the last colon followed by spaces rather than the task name delimiter.

Fix

Changed :\s* to :\s{2,} (colon + 2 or more spaces). This works because:

  • task --list-all output uses multiple spaces (4+) for column alignment after task names
  • Colons in descriptions typically use single spaces (: https://, : description)

Test Cases

Taskfile Task Name Description
run: desc: Run with shiny::runApp() run Run with shiny::runApp() ✓
gorelease:install: desc: "Installs: https://..." gorelease:install Installs: https://... ✓

@vmaerten vmaerten self-assigned this Dec 12, 2025
@vmaerten vmaerten added the area: completions Changes related to shell completions and scripts. label Dec 12, 2025
Change sed pattern from `:\s*` to `:\s{2,}` to require 2+ spaces after
the colon delimiter. This prevents greedy matching through colons in
descriptions like `shiny::runApp()` or `https://example.com`.

The `task --list-all` output uses multiple spaces for column alignment,
while descriptions use single spaces after colons.
@vmaerten vmaerten force-pushed the fix/fish-completion-colon-in-description branch from 72a6fbb to 2986861 Compare December 14, 2025 14:54
@vmaerten vmaerten merged commit 655e834 into main Dec 14, 2025
13 checks passed
@vmaerten vmaerten deleted the fix/fish-completion-colon-in-description branch December 14, 2025 14:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: completions Changes related to shell completions and scripts.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fish completion breaks if task description have colon (:)

2 participants