FiloSottile / FiloSottile/passage

Bug in zsh completion?

Open
#62 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Shell
Stars
1.2k
Forks
54
PR merge metrics
No merged PRs in 30d

Description

I think that there may be a bug in the completion file for zsh. Here's how to trigger it.

```shell
passage -
```

After tabbing at that position, the cursor moves one character left (!), so that the next character you enter is placed **before** `-` rather than after it.

I am not especially comfortable with zsh completions, but I have a version that works for me [in this gist](https://gist.github.com/telemachus/e6d3eb61905e1cfa9e36d2a8e47ab228). (Briefly: I think the problem is that the current completion [mixes its handling of command-level flags and subcommands](https://github.com/FiloSottile/passage/blob/main/src/completion/pass.zsh-completion#L85-L106).) I'm happy to submit a PR, but I'm hoping to see (1) if other people have experienced the same problem and (2) if my solution looks good to people who know more about zsh completions than me.

Contributor guide

Open the contributing guide

Research direction

Reproduce the issue with `passage -` and inspect `src/completion/pass.zsh-completion`, especially lines 85-106 where command-level flags and subcommands are handled. Compare the current completion with the linked gist; done means completing at that position no longer moves the cursor left and subsequent input appears after `-`.

Written by the indexing model from the issue text.

Assessment

Tech stack
zsh
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.