Search code examples
pythonpython-3.xescapingcursespython-curses

Python curses program. What char is ^?


I've got a program using curses with python3. When the user hits backspace I try to catch it like so:

elif (ch == curses.KEY_BACKSPACE or
      ch == 8): #8 is ASCII backspace, appears in terminal as ^H if not handled
    ...

But now my cygwin terminal is sending ^? when I type backspace. I'm familiar with ^A equals ASCII 1, ^B equals ASCII 2 etc, But what character is ^?, and how can I catch it using curses?


Solution

  • "^?" is the DEL character, \x7f.