Some terminals will send ^?
as backspace, some other terminals will send ^H
.
Most of the terminals can be configured to change their behavior.
I do not want to deal with all the possible combinations but I would like to accept both ^?
and ^H
as a backspace from python.
doing this
os.system("stty erase '^?'")
I will accept the first option and with
os.system("stty erase '^H'")
I will accept the second one but the first will be no longer available. I would like to use
raw_input("userinput>>")
to grab the input.
The only way I was able to figure out is implementing my own shell which works not on "raw based input" but on "char based input".
Any better (and quicker) idea?
raw_input
– Eloiseelonreadline
to makeraw_input()
use it automatically. See the docs for information on how to rebind keys etc. – Orchestrate