It seems that bash doesn't want to autocomplete commands (what's annoying me right now is not autocompleting apt-get) when I'm logged into my machine from SSH. Is there some setting that will allow bash to autocomplete inside an ssh session?
Bash – How to Enable Autocomplete in SSH Session
autocompletebashssh
Related Question
- Bash – How to trigger autocomplete without a tab key
- Bash Zsh Autocomplete – Ignore Certain Files in Directory with Autocomplete
- Bash – Prevent customized bash autocomplete from affecting io redirection (< and >)
- Why Exporting a Variable in SSH Shell Prints Exported Variables List
- Bash – Running Multiple Commands During an SSH Inside an SSH Session
Best Answer
In short:
source /etc/bash_completion
should do the trick (run it in the shell within the SSH session).Long story: in order for bash completion to work, you have to tell
bash
how to complete each command's arguments. This requires a long sequence of invocations of thebash
built-in commandcomplete
; therefore, they are usually collected in a separate script (or several ones in/etc/bash.complete.d/*
) that loads them all.Being a regular shell script, you can always load the
bash_completion
in any shell startup script (~/.bash_profile
,~/.bash_login
,~/.bashrc
)Further reading:
bash(1)
complete
command (run:help complete
inbash
)