[GTALUG] SSH Host tab completion

Giles Orr gilesorr at gmail.com
Fri May 31 16:54:20 EDT 2019


I've had a very similar problem with ssh host tab completion - the primary
difference seemed to be that it worked on Mac and not on Linux.  (I never
use console these days, so I couldn't tell you about that.)  I solved it as
you did - by a more specific call to the completion file(s) in by bashrc.
Although I think I sourced the one specifically for SSH hosts.

I can't remember if it was here (ie. TLUG) or somewhere else that I saw a
conversation about the incredibly tortuous routing of Bash startup.  It was
months or even a couple years ago.  Essentially, someone had attempted to
map out the decision process behind what files got parsed when Bash started
depending on all the little check-boxes: is it interactive, is it console,
is it login, dozens of others.  The flow chart created was enough to make a
hardened system administrator cry.  So the direct route - add what you want
to the bashrc - is definitely preferred to trying to actually debug what
happened.

On Fri, 31 May 2019 at 11:02, Daniel Wayne Armstrong via talk <
talk at gtalug.org> wrote:

> Resolved the issue by adding ...
>
> source /etc/profile.d/bash_completion.sh
>
> ... to my ~/.bashrc, though I still don't know why it would auto-complete
> OK inside tmux.
>
> On Thu, May 30, 2019 at 4:24 PM Daniel Wayne Armstrong <
> daniel at circuidipity.com> wrote:
>
>> Hello all ... I am currently running Debian Buster and Bash shell. I have
>> a few Host aliases defined in my ~/.ssh/config. Example: Host test-server.
>> So when, in console, I type ...
>>
>> $ ssh tes
>>
>> ... and hit Tab, then auto-completion fills out ...
>>
>> $ ssh test-server
>>
>> When I try to do the same thing in a terminal (urxvt), tab completion
>> does *not* work. The complete host alias has to be entered.
>>
>> *But* tab completion for ssh host aliases *does* work if entered within
>> tmux running in the terminal.
>>
>> Any idea how I can get tab completion working for ssh host aliases in the
>> terminal?
>>
>> --
>> Daniel Wayne Armstrong  https://www.circuidipity.com
>> <http://www.circuidipity.com>
>> Accomplish the great task by a series of small acts. -- Lao Tzu
>>
>>
>
> --
> Daniel Wayne Armstrong  https://www.circuidipity.com
> <http://www.circuidipity.com>
> Accomplish the great task by a series of small acts. -- Lao Tzu
>
> ---
> Talk Mailing List
> talk at gtalug.org
> https://gtalug.org/mailman/listinfo/talk
>


-- 
Giles
https://www.gilesorr.com/
gilesorr at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://gtalug.org/pipermail/talk/attachments/20190531/ee866c08/attachment.html>


More information about the talk mailing list