I'm tinkering with the VT100 emulation in the various linux terminal (e.g. xterm, gnome-terminal,etc) and need help with getting a python script to receive the non-printable escape sequences from the emulator. I think I got a handle on the VT100 emulation part; this is a question about python.
I want to run the following VT100 "Identify terminal type" query within python:
print "\x1b[c"
resp = raw_input()
print ":".join(x.encode('hex') for x in resp) # debugging purpose only
I works almost nicely with the terminal's VT100 emulation EXCEPT that resp = raw_input()
requires me to manually complete the response by pressing the ENTER
key.
How do I get python to take the input from the VT100 emulation without manual intervention on my part?