Open eliranwong opened 2 years ago
@eliranwong,
This depends on the terminal application. Which application are you using? The built-in terminal? What if you try something else? (Alacritty or iterm2)? I'm honestly not sure that any of these are supported on OS X. The control-arrow keys seem to be mapped to certain system-wide shortcuts. I think the shift-arrow keys are supposed to work in Alacritty at least.
If you want to test. Run od -i
in the terminal. Type any of these key combinations and see whether the output appears in this file: https://github.com/prompt-toolkit/python-prompt-toolkit/blob/master/src/prompt_toolkit/input/ansi_escape_sequences.py and are linked to the right keys.
Jonathan
@jonathanslenders thanks for reply.
when key binding does not work, is there any ways to select lines, by using shift+down / up, just like I can do in many text editors?
key binding c-up, c-down, c-right, c-left, s-up, s-down, s-right, s-left does not work
The following link content says I can use the keybindings listed above, but I tried all of them, none work on my macOS or Linux terminal. https://python-prompt-toolkit.readthedocs.io/en/master/pages/advanced_topics/key_bindings.html
I want to selection work across lines when users press shift+up or shift+down in multiline prompt, just like what I normally can do in other applications. Unfortunately, when I press shift+up, the cursor goes up without any selection.