Open harleypellowe opened 5 years ago
Good point! I think the documentation is wrong here. On posix systems (Linux, mac, ...), control-a is the same as control-A. On Windows it can work, but I don't think we support it.
Is there really no way around this? I would like to have Ctrl+Shift+Z to be a possible redo binding at least.
The only way to add Control-Shift keys is to enable your terminal emulator to send specific escape codes for them, and then add those codes to prompt-toolkit (which is currently broken in prompt-toolkit 3.0, see https://github.com/prompt-toolkit/python-prompt-toolkit/issues/993). On Mac both the default Terminal.app and iTerm2 let you do this. On Linux the only terminal I know that lets you do this is Konsole. You can set any CSI-style escape code you want, but I recommend using the official ones (see https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h2-Alt-and-Meta-Keys). For instance, for Control-Shift-Z, use "\E[27;6;90~"
(Z
is ASCII character 90).
The documentation indicates it should be possible to keybind ctrl+\<uppercase letter>, but in practice I haven't been able to get it to work.
It looks like those key combos would need to be added to
python-prompt-toolkit/prompt_toolkit/keys.py
. I'm not sure if this is a bug, or if I'm just misunderstanding how this works (I've just started learningprompt-toolkit
).