Skip to content

Tag: terminal

Prevent Kivy leaving debug messages

I have a simple a Kivy interface that also uses the terminal. Example code: The problem is that whenever I start the script I get this: I have found that this is Kivy’s automatic debugging messages. How do I prevent them (or at least hide so that I can use the terminal)? Answer As shown in the docs, you…

How can I get the cursor’s position in an ANSI terminal?

I want to get the cursor’s position in a terminal window. I know I can echo -e “33[6n” and read the output -s silently as in this answer, but how can I do this in Python? I’ve tried this contextmanager like this: but it only captures the e[6n (‘x1b[6n’) escape sequence I wr…

Unable to fake terminal input with termios.TIOCSTI

Most of the code samples I’ve seen are trying to read from stdin without local echo. To do this they modify the “local modes” flag to remove the setting to “Echo input characters”. I thought I could just modify the “input modes” flag to TIOCSTI which is for “Ins…