9

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?

  • 2
    Try to run reset for a good start. Of course you cannot enter now any command into this terminal so from another one try something like cat >/dev/pts/3 where 3 is your problematic terminal number and then hit the following keys: ESC c ENTER Ctrl-D. – jimmij Oct 30 '14 at 9:34
16

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 ctrl-c 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.

  • Ah that makes sense. I tried hitting both ctrl + c and ctrl + z but didn't seem to accomplish anything. – Kit Sunde Oct 31 '14 at 7:03
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.

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.