Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Please give me one or two examples of "fairly common situations" where it takes >=20 seconds for bash to respond to the tab.


Filename completion on remote systems using ssh/scp. It is a fairly common situation for me, although I wouldn’t say it takes 20s. Maybe 2-5s?


Setting up SSH multiplexing with ControlPersist[1] can help quite a bit here, since after the first connection you don't have to go through the init/connection phase for subsequent completions.

You can even preemptively fire up a master connection to commonly accessed hosts to avoid the initial delay.

[1] https://en.wikibooks.org/wiki/OpenSSH/Cookbook/Multiplexing


Ah, that’s interesting! I assumed that something like that was going on, as subsequent completions take much shorter (in the same command), but I did not know about preemptively connecting to common hosts.

Thank you very much, I’ll try to play around with it :)


When you are working on a networked filesystem, and someone else has foobared it by doing something stupid.


it regularly happens when I want to expand ~username to /home/username


If It takes 20 seconds for bash to convert `~` to `/home/` something is terribly wrong with your system.


I'm guessing either they are using nis (which it often takes 20s for a passwd lookup) or they have done ~foo/<Tab> which needs to list the home directory; large home directorys on networks can easily take 20s for list.

Neither of those is what I was talking about though, as they aren't really part of the smart complete. To answer your question, I don't have an example, I just know that I tried ubuntu a while ago and smart complete would hang all the time. I don't currently have an ubuntu machine, so I can't try to track it down.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: