Currently, most \C-\<…> (Ctrl+…) combinations raise the following error:
Python 3.14.0 (main, Oct 7 2025, 15:35:21) [Clang 20.1.4 ] on linux Type "help", "copyright", "credits" or "license" for more information. >>> from _pyrepl.simple_interact import _get_reader >>> reader = _get_reader() >>> reader.bind(r"\C-\<backspace>", "unix-word-rubout") Traceback (most recent call last): File "<python-input-2>", line 1, in <module> reader.bind(r"\C-\<backspace>", "unix-word-rubout") ~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/gideon/.local/share/uv/python/cpython-3.14.0-linux-x86_64-gnu/lib/python3.14/_pyrepl/reader.py", line 756, in bind self.input_trans = input.KeymapTranslator( ~~~~~~~~~~~~~~~~~~~~~~^ self.keymap, invalid_cls="invalid-key", character_cls="self-insert" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ) ^ File "/home/gideon/.local/share/uv/python/cpython-3.14.0-linux-x86_64-gnu/lib/python3.14/_pyrepl/input.py", line 72, in __init__ keyseq = tuple(parse_keys(keyspec)) ~~~~~~~~~~^^^^^^^^^ File "/home/gideon/.local/share/uv/python/cpython-3.14.0-linux-x86_64-gnu/lib/python3.14/_pyrepl/keymap.py", line 113, in parse_keys k, s = _parse_single_key_sequence(keys, s) ~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^ File "/home/gideon/.local/share/uv/python/cpython-3.14.0-linux-x86_64-gnu/lib/python3.14/_pyrepl/keymap.py", line 189, in _parse_single_key_sequence raise KeySpecError("\\C- followed by invalid key") _pyrepl.keymap.KeySpecError: \C- followed by invalid key >>>  Only Ctrl with any normal key, \C-\<up> (Ctrl+Up), and \C-\<down> (Ctrl+Down) are allowed, as found in the source code:
Why is this the case? Can support for other keybinds be added?
My primary motivation is binding \C-\<backspace> (Ctrl+Backspace) to delete the previous word (similarly to Alt+Backspace or Ctrl+W).