GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — mcpx: zsh completion script fails to parse (unquoted _describe entries) · Issue #272 · developing-today/code

mcpx: zsh completion script fails to parse (unquoted _describe entries) #272

New issue
Copy link
New issue
Copy link
Closed
#273
Closed
mcpx: zsh completion script fails to parse (unquoted _describe entries)#272
#273
Copy link
Assignees
dezren39

Description

@dezren39
dezren39
opened on Oct 18, 2026
Issue body actions

Bug

mcpx completion zsh generates a script that zsh cannot parse.

This is the same defect as dezren39/darwin-nix#365 (fixed there by PR #379), present in this repo's pkgs/mcpx copy: the fix was never ported here. pkgs/mcpx/internal/cli/completion.go (~line 92, zshCompletion) still emits each _describe commands entry unquoted:

fmt.Fprintf(&b, "    %s:%s\n", c.Name, zshEscape(c.Summary))

Summaries carry apostrophes, parentheses and glob brackets — e.g. prompts: list or render a server's prompts (manual.go:414) and search: find tools by name and description (keyword or semantic). zshEscape turns ' into '\'', which is only valid inside single quotes, and leaves parens/brackets bare.

Reproduction (verified on main a29abd3, 2026-10-18)

$ go build -o /tmp/mcpx ./cmd/mcpx   # in pkgs/mcpx
$ /tmp/mcpx completion zsh > comp.zsh
$ zsh -n comp.zsh
comp.zsh:192: parse error near `;;'
$ echo $?
1

Generated array (excerpt):

    prompts:list or render a server'\''s prompts
    resources:list or read a server'\''s resources
    search:find tools by name and description (keyword or semantic)

No existing issue in this repo tracks this (gh search issues --repo developing-today/code zsh → none); there is also no internal/cli/completion_test.go in this copy.

Why it matters

Anyone who installs the zsh completion gets a script their shell rejects at load — the completion feature is simply broken for zsh users, silently. It was already diagnosed and fixed once in the sibling copy; letting the copies drift means users here keep the broken version.

Suggested fix (mirrors dezren39/nix PR #379)

  • Emit each commands entry single-quoted: '%s:%s' with a new zshDescribe helper that only handles _describe's own syntax (backslash-escape : inside the description, '\'' for apostrophes) instead of reusing zshEscape.
  • Keep zshEscape for the flag-description sites, which are already inside single quotes.
  • Port the regression tests from nix (internal/cli/completion_test.go): every commands entry is single-quoted, an apostrophe-bearing entry is present, and zshDescribe escapes colons/quotes.

Acceptance criteria

  • mcpx completion zsh | zsh -n exits 0
  • bash/fish completions still parse (bash -n, fish -n or equivalent)
  • New regression tests in internal/cli fail on the pre-fix code and pass with the fix
  • go test ./internal/cli/ passes

Activity

  1. github-actions
    assigned
    dezren39
    on Oct 18, 2026
  2. dezren39
    closed this as completedin #273on Oct 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @dezren39
    dezren39

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.