New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
completion ignoring . prefixed arguments #3707
Comments
This is by design. The default file completion will only show hidden files if your argument starts with a We wouldn't introduce a config option for this. I thought it should be possible to write a custom completion, but it looks like fish squashes custom completions that start with For now though I think this just isn't possible, sorry! |
I'm asking about custom completion not for file completion. |
@nhooyr: Please update this issue with your custom completion script that is not working as you desire. I cannot tell from your asciinema recording what It should be possible to inhibit the usual file name completion for strings beginning with |
Sorry, I didn't realize I was so unclear when I wrote this. Here is the script https://github.com/nhooyr/dotfiles/blob/812056d8e13d99dd6bb3eced79b8d13dbb8e91d5/.config/fish/completions/bd.fish Fish doesn't show me |
Hmmm, okay, you're adding an explicit completion that includes arguments that begin with a period:
And those do not show up in the completion list. I'm inclined to agree that explicitly enumerating arguments that begin with a period should be displayed and selectable after pressing [tab] even if you haven't typed a period. Whereas the behavior for file name expansion should continue to exclude such file names unless you have started the argument with a period before pressing [tab]. |
Yes, me too - the hidden file behavior is only supposed to apply to files, not bespoke completions. |
I would like this tooThis would be a useful enhancement to me -- my company has a practice of having CI code in a complete -f -c git -n '__fish_git_using_command add' -a '(__fish_git_files modified untracked deleted unmerged modified-staged-deleted)' ( Each time I do a tab completion for this, I get confused for a second, go "oh right", and add a dot and press tab again. It's a minor annoyance, but one I deal with very frequently. Temp. solution for git add specificallyNow that I've figured out it's fish's fault, and not a misconfigured git, I can do something about it. For anyone else with this same exact function confirm -a 'prompt' -d "Confirm whether or not to do something"
if test -z "$prompt"
set prompt 'Are you sure?'
end
read -f -p "set_color green; echo \"$prompt [y/N]\"; set_color normal" response
switch "$response"
case y Y
true
case '*'
false
end
end
function gap -d "Git add one file, or prompt for all"
if [ (git status --porcelain | wc -l) = 1 ]
git add -v -A # -v prints the added file
else
# can we prompt one by one, but better than git add --interactive?
git status; confirm "Add all?"; and git add -A
end
end Replacing |
By default, fish does not complete files that have leading dots, unless the wildcard itself has a leading dot. However this also affected completions; for example `git add` would not offer `.gitlab-ci.yml` because it has a leading dot. Relax this for custom completions. Default file expansion still suppresses leading dots, but now custom completions can create leading-dot completions and they will be offered. Fixes fish-shell#3707.
Fixed in b7de768. Thank you for filing. |
This comment was marked as outdated.
This comment was marked as outdated.
By default, fish does not complete files that have leading dots, unless the wildcard itself has a leading dot. However this also affected completions; for example `git add` would not offer `.gitlab-ci.yml` because it has a leading dot. Relax this for custom completions. Default file expansion still suppresses leading dots, but now custom completions can create leading-dot completions and they will be offered. Fixes #3707. (cherry picked from commit b7de768)
sh -c 'env HOME=$(mktemp -d) fish'
)?fish version installed (
fish --version
): 2.4.0OS/terminal used: macOS 10.12.2 iTerm 3.0.13
completion ignores arguments that start with
.
. I think this is to ignore dotfiles but I have a command that can be completed with a file that starts with.
and it should not be ignored. Is it possible to disable this?watch https://asciinema.org/a/9wnu3jy22hxfjf4au18m7ob29
The text was updated successfully, but these errors were encountered: