Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Here is my scenario:

I want to transfer ~/foo.txt to a server aoneill@bar.

I start typing in my command line:

aoneill@aoneill-Laptop:~$ scp fo

At this point I hit <tab> to complete the file name, and my terminal just freezes up. It won't change based on any keystroke, and the cursor is just stuck right next to the fo, unless I <ctrl-C> out.

I am running Ubuntu 13.10, and I do include . /etc/bash_completion in my .bashrc.

This is the only program I really encounter this issue with, and it doesnt seem to be a common problem.

Thanks for the help!

share|improve this question
    
I think we need more info to figure this out. Does this happen with every file and every folder? It only happens with scp? Do you have any customizations in ~/.bashrc? What configuration do you have to look up hostnames, is it DNS? –  Kevin Panko Feb 11 at 19:59

1 Answer 1

up vote 0 down vote accepted

At this point I hit tab to complete the file name, …

… and the computer, entirely failing to read your mind, did what it actually does when tab is hit at that point, which is try to complete a hostname, possibly consulting all sorts of things from the output of avahi-browse to the output of ruptime. This process can take some time.

(The brave can go and look at the _known_hosts_real function in /usr/share/bash-completion/bash-completion.)

To have completion of a filename at that point, the word that you have typed must either contain a slash (/) character or begin with a dot (.) or a tilde (~) character.

(The brave can similarly see why that is from the _scp function in /usr/share/bash-completion/completions/scp.)

share|improve this answer
    
Perfect! Thank you. I'll keep that in mind when I use ssh/scp in the future! –  AlexO'Neill Feb 14 at 16:48

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.