2

Occasionally a terminal gets into a state where the Enter key no longer properly terminates text input prompts. For example, when running sudo I generally just type my password and push Enter. Sometimes, however, pushing Enter has no apparent effect and I have to enter an EOF character with Ctrl+D. This weird behavior then persists for the remainder of the terminal's life.

What causes this behavior?

1 Answer 1

3

Somehow you managed to change the terminal's mode. Save the initial state to a file with ‛stty -a >s.1‛, later when it happened, save it to s.2 and compare the 2 files or add them to your question.

5
  • Thank you! (Un)fortunately, this is a fairly rare occurrence so I can't test your theory right now, but this has been happening periodically for years and this is the first time I've had any idea where to look. I'll follow your advice at the next opportunity.
    – Drew Frank
    Nov 6, 2012 at 21:06
  • You could save the terminal's state now while it's ok, so you have it handy when it fails.
    – ott--
    Nov 6, 2012 at 21:29
  • 1
    I got impatient and took a look at the stty man page. By default, the setting "icrnl" is active, which translates input carriage returns to newlines. If I explicitly disable that with stty -icrnl then the terminal exhibits the behavior I describe in the question. Flipping it back with stty icrnl restores normal function. I'll consider the question solved -- the only mystery is how I am inadvertently changing this setting.
    – Drew Frank
    Nov 6, 2012 at 22:08
  • 1
    Maybe an editor or another curses-program that crashed?
    – ott--
    Nov 7, 2012 at 7:21
  • Clever. Upon investigation, I'm pretty sure the main cause of this for me is a segfault of ipython. Thanks again for your help debugging this, ott; it's so satisfying to finally know what's going on!
    – Drew Frank
    Nov 8, 2012 at 6:46

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .