cli icon indicating copy to clipboard operation
cli copied to clipboard

Complete file name when there are no completion matches

Open segevfiner opened this issue 5 years ago • 3 comments

A common behavior for inaccurate/incomplete/auto-generated completion scripts is to complete file names when there are no completion matches, like the shells default behavior.

To enable for Bash, you simply add -o default to the complete call in the completion script. For Zsh, you can add something like this after trying to add the completions (There might be a better way to replicate this behavior in Zsh, but I didn't find any):

if [[ $compstate[nmatches] -eq 0 && $words[$CURRENT] != -* ]]; then
    _files
fi

segevfiner avatar Oct 30 '18 10:10 segevfiner

Thank you sir!

yahavi avatar Jun 27 '19 07:06 yahavi

This issue or PR has been automatically marked as stale because it has not had recent activity. Please add a comment bumping this if you're still interested in it's resolution! Thanks for your help, please let us know if you need anything else.

stale[bot] avatar Feb 25 '20 08:02 stale[bot]

Closing this as it has become stale.

stale[bot] avatar Mar 26 '20 08:03 stale[bot]

Works with latest release.

dearchap avatar Aug 28 '22 13:08 dearchap