All Questions
Tagged with bash-completion tab-completion
28 questions
1
vote
1
answer
76
views
zsh completion function (compdef) not completing _arguments
I am writing an autocomplete function for my personal cli. Here below is a reduced version of my compdef.
As I type my-cli <TAB> I can see the subcmd autocompleting.
As I type my-cli macos <...
0
votes
0
answers
51
views
bash complete to empty string while still escaping characters in file completions & appending / to dir completions
TL;DR
In bash (preferably bash 3+), how can I support empty string ('') as a completion (amongst others) for a value for an option for a command, while also supporting path completions for other ...
1
vote
1
answer
54
views
Git autocomplete custom command (not arguments after)
I've been trying to add an autocomplete for my custom command, "git extract-unmerged". I'm using git on Windows in git bash through MSYS2 if it matters.
I created a bash script in $HOME/...
0
votes
1
answer
215
views
(Git)Bash programmable completion with short '-...' and long '--...' options
I created a completion function inspired by How to Create a Custom Bash Completion Script (which has some obvious errors but I corrected these) and in a newer version on GitHub.
bash_completion_test
#!...
3
votes
2
answers
715
views
Compgen doesn't complete words containing colons correctly
I'm encountering a problem with creating a Bash completion function, when the command is expected to contain colons. When you type a command and press tab, Bash inserts the contents of the command ...
3
votes
0
answers
507
views
How do I get bash tab-completion to stop escaping glob wildcards at the beginning of the argument? [closed]
When I try to use tab-completion in bash for a file glob pattern starting with either ? or *, I get the list of completion options as intended, but then my command prompt is modified to escape the ...
1
vote
0
answers
99
views
Possible to override bash environment variable completion?
I'm trying to figure out how to use the complete bash builtin to override tab completion of "environment variables." That is, when there is a dollar sign $ to the left of the cursor, with all ...
1
vote
0
answers
85
views
Change Bash filename autocompletion for aliases to be different than default
I have a custom alias for vim that I use for opening TeX files (allows proper functioning with vimtex:
alias vtex="vim --servername VIM"
It would be great if tab-completion of files only accepted ....
0
votes
1
answer
472
views
Bash completion not working when environment variable defined
When I define an environment variable inline like this: env_variable=true command, my custom bash completion script fails. Example:
user@host in /tmp/tmp.6DRvQAkpFe
> ls
user@host in /tmp/tmp....
6
votes
1
answer
241
views
Why does "$<space><tab><tab>" perform filename completion?
While trying to configure the programmable completion, I came across a behavior I don't understand.
Given those three completion scenarios, this is the way I understand them:
$<TAB><TAB>...
6
votes
3
answers
2k
views
Can I disable a particular git command?
With new versions of git new commands have been added which I will probably never use.
Is there a way I can disable these commands so that I my tab completion is faster?
For ex: before, git check<...
-3
votes
1
answer
66
views
I write a bash file using tab-completion by complete command, but in zsh it didn't work
source code:
#!/bin/bash
complete -W 'word1 word2 word3 aa bb' ./test.bash
echo "the param is: $1"
When I run ./test.bash , turns out the file list of current dir.
complete command doesn't work in ...
4
votes
1
answer
1k
views
Hints for custom bash completion
I am developing a custom bash completion command to capture job IDs from a scheduling system (LSF, PBS, SLURM). I've got the basic functionality, but I would like to extend it now with "hints" that I'...
2
votes
1
answer
100
views
Strange javac Tab Completion for Classpath
The javac command has strange tab completion with -cp and -classpath. I was under the impression -cp was an alias for -classpath. However, when I press tab after the -classpath flag, I get .jar files ...
3
votes
3
answers
845
views
Is it possible to display some help message when showing autocomplete candidates?
Some commands have many -x (x can be any English letter) options and it's some times difficult to remember all of their meanings. I can use bash's compgen -W '-a -b -c' to show possible options and I'...