I have a signal handler which does its job, but the only ugly thing is whenever Ctrl+C is pressed, a “^C” shows up in the terminal. How do I get rid of that? Or is that a shell behavior?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If you are on a Unix platform, the easiest way to control the terminal is the
cursesmodule. You can turn the echoing of typed characters off withcurses.noecho(), turn it on again withcurses.echo(), or wrap a function call incurses.wrapper()to turn echoing off during the function call. The latter is the preferred approach — it will automatically restore the terminal state if an exception occurs.