2

This problem has been discovered by me and also another user, so it does not seem to be related to either of our own configurations. I That said, I am SSH’ing to the machine from a Mac, he is using another Linux machine.

When we SSH into an Ubuntu 14.04 machine, we notice that pressing the tab key logs us of the SSH session. Meaning, the session just drops and we have to start all over. As a result, tab completion does not work.

Any ideas?

6
  • When you login via ssh, open a sub bash shell in the ssh session (just type bash) and then type 'set -x'. That will turn on extensive debug output. The nested sub shell should prevent disconnection when you hit tab. Once you've done that, just hit tab and see what it outputs. – Argonauts Sep 9 '16 at 20:32
  • Hmm, tried this, nothing happens. Meaning, tab works as expected. – NOP Sep 9 '16 at 20:34
  • 1
    I'm not sure what 'as expected' means. Disconnected? Sub shell exited? Completion? – Argonauts Sep 9 '16 at 20:36
  • Meaning tab completion works. We don't exit. – NOP Sep 9 '16 at 20:37
  • 1
    I'm guessing there is an issue with your tab completion implementation - maybe someone modified it at some point. To confirm that completion is ending the current bash shell, type 'echo $SHLVL' before hitting tab, and then again afterwards. Otherwise follow the same process as before. SHLVL contains the number of nested shells you currently have. If after hitting tab it has decreased by one, then you know a shell exit occurred. Look carefully through the debug output during tab completion for the word exit or similar – Argonauts Sep 9 '16 at 20:53
0

Even though your problem was the destination machine overheating, I'll share another solution that may be relevant to others: This can happen if you have set -e set in your bash shell. You can check with:

sh
$ echo $-
ehimuBHs

If you see an e, that means your shell will exit on any error code (you can test by running false).

For a temporary fix, run set +e to disable that option. Similar with -u, generally you don't want that option in your main shell.

You will want to track down how that happened to prevent it from happening again. One possible way is if you source a script that has set -e in it. Check all your .profile, .bashrc, and any scripts that are called by them.

For more details, see this answer.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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