I have noticed sometimes that tab completion is helpfully filtered in bash. I am a java programmer and often use the java
and javac
commands in the terminal for quick or remote tasks.
Say I have the two usual files in a directory: MyProgram.java
and MyProgram.class
If I ask bash to tabcomplete from the command prefix java M
, it fills straight out to java MyProgram
, this is helpful. Clearly either bash is configured to only accept *.class completions for the java
command (and knows to strip the file extension), or the java
command is telling bash this somehow.
I would like to accomplish the same with a text editor, so I could type in nano M
and have it tab complete to nano MyProgram.java
rather than pausing at nano MyProgram.
, is it possible to say, blacklist *.class from nano's tab complete?
Most of all I'd just be interested to know if this is a bash configuration or something program-side.