1

I'm working on bash in Ubuntu and I have a python program using some threading code. It works well, but after I kill it pressing CTRL+C, the shell just breaks. No input is shown to me (although it still is interpreted in the background) and the only thing that works is the enter key, albeit in a weird fashion.

thunder@machine:~/server/api$ thunder@machine:~/server/api$

Well actually it doesn't work, it just places a new prompt line right next to the previous one.

I think something is messing up with my shell, so I was wondering is there a way to "reset" it? right now I have to open a new shell session and that is very annoying.

To know what is causing this problem to begin with would be great, but I don't think that's possible with the little information I just provided here. And frankly I have no idea of where in my code I could be messing things up, since like I said before the program does work correctly.

Nelson

2
  • 1
    In your terminal type reset and then press ctrl+J
    – anubhava
    Feb 19, 2015 at 17:00
  • 1
    A possible explanation is that your program corrupted the tty; read tty demystified Feb 19, 2015 at 17:02

1 Answer 1

2

You need to reset the terminal by typing

resetEnter

into the bash shell (you might need to do it blind, i.e. without seeing the characters being echoed).

See man 1 reset.

1
  • You might also need to press Ctl-j instead of Enter.
    – Barmar
    Feb 19, 2015 at 17:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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