12

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?

1
  • 4
    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
    Commented Oct 30, 2014 at 9:34

2 Answers 2

25

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.

1
  • Ah that makes sense. I tried hitting both ctrl + c and ctrl + z but didn't seem to accomplish anything.
    – Kit Sunde
    Commented Oct 31, 2014 at 7:03
3

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.

You must log in to answer this question.

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