Linux – How to interrupt stuck bash tab completion

bashlinux

Case:

  • A Windows share mounted using samba over a flaky VPN connection (sometimes very slow, sometimes it drops)
  • When doing tab-completion on filenames, my bash shell can freeze up if the VPN is slow or dropped when I am attempting the tab completion.

Example:

$ cp myfile.zip /mnt/winbox-c/Progr<tab> key pressed here

Is there a key I can press to get bash out of its hung state when this happens?

Best Answer

Try CTRL+C

This works for me in tcsh and I believe it should work in bash as well.