What can I do if bash stops echoing?

One of the applications I use at work sometimes screws with my bash and so I don’t see my own input anymore. I.e.

$ echo foo
foo
$

becomes

$ foo $

I incorrectly tried to run stty -echo which made matters worse and now it stopps accepting commands all together which put my input in some state that just causes > to appear every time I line break and nothing else.

What should I have done?

Answers:

Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.

Method 1

The usual remedy for things like this is

stty sane

The stty -echo should not have made this worse, as that just turns off echoing of input, and you already had that.

The fact that you say returns just causes > to appear means that you’ve started somethng that is causing continuance over the next lines, e.g. echo ' will do that because it’s waiting for the closing ' to terminate the string. Other things will cause this as well, such as if something; it’s waiting for the then ... fi part.

You could probably have hit ctrlc at that stage to stop it waiting for the rest of the command, unless the terminal was so messed up that interrupts were also not being generated.

Method 2

In addition to @wurtel’s answer (especially the likely explanation of the > problem), stty echo is the opposite of stty -echo, so you might use that. You can also use reset, which usually comes with ncurses packages.


All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x