Remix.run Logo
queenkjuul 6 hours ago

I think fish does this? I know it gives me branch names as completion options sometimes, idk how aware it is of the specific flags.

hnlmorg 4 hours ago | parent | next [-]

All shells do. Even alternate shells like Murex and Nushell.

The problem isn’t that they can’t, it’s that writing context aware shell completions is hard because every tool does things slightly differently, and typically completions are not done by the same people who wrote the CLI tool to begin with.

So you end up with a thousand edge cases where stuff isn’t 100% correct.

tiltowait 5 hours ago | parent | prev [-]

fish is a bit insonsistent on it. For instance, `git add <tab>` will only autocomplete for modified files. It will also fill in wildcards, e.g. `cat *.txt <tab>` will expand to show all .txt files. On the failure side, `rm foo <tab>` will still show `foo` as an option.

IME, zsh has better autocompletion (which, at the time at least, was a separate install).

epage 4 hours ago | parent [-]

There are a couple differen things going on

- completions being aware of the subcommand

- dynamic look ups for specific values

- completions being aware of previous options, flags, and values

A lot of completions have the first. Some have the second. The last is rare. The completer needs knowledge of when flags, options, and value can be repeated and change which future options and values are suggested.