New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feat(textinput): ctrl + left/right bindings for word jumping #150
Comments
Hi! There are a few questions here so I'm dividing my response into sections accordingly. Ctrl + ArrowsGood catch! We should absolutely add support ctrl+arrows and word-jumping as soon as charmbracelet/bubbletea#292 is merged. That PR adds support for ctrl+arrow mappings, among another things. Ctrl versus AltYou're correct, ctrl is treated differently than alt for technical reasons, and that's actually why we can't provide a mapping for ctrl+backspace and ctrl+delete. ctrl modifiers in the terminal originally existed to send control characters through the wire and manipulate the terminal, which is mostly why they're so limited. For example backspace and ctrl+h both send a backspace to the terminal, and there isn't much way around that.
Anyway, all this said, we have considered separating out shift, ctrl, and alt modifiers so that they’d be more like |
Appreciate the quick info! I am unsurprised that there are deep legacy issues at hand with respect to handling keyboard input in the terminal. Happy to see progress on the arrows. |
@meowgorithm heyhey looks like the PR you mentioned with the requested changes was merged, can I go ahead and close this issue? |
@bashbunni Heya! We added the necessary key binding support in Bubble Tea to make this possible however we still need to add bindings to textinput for ctrl + left/right for word jumping as described above. So what should happen (in this order is):
|
Is this still in progress? I'm trying to either use shift+enter to "submit" the text input value. Or use enter for "submission" and shift+enter for a new line. Is there a way to achieve this with the current implementation? I've tried a few things but nothing worked. |
Hey @tartavull We are planning to add a way to support |
Fixed by #387 |
Expected behaviours:
The above are default behaviours in most linux and windows text editing environments. It would be nice to have them respected by the
textinput
.Having spent 3 minutes reading the textinput.Update, I see that a lot of care has gone into handling some specific cases of input for the
textinput
bubble.Having spent 5 minutes working in a local fork, I see that keystrokes do not come with
Ctrl
modifiers in the same way asAlt
modifiers, and that the specificKeyCtrlN
values are for letters only, and do not include the needed values for the above updates.Is it correct to assume that there is some technical reason why
Ctrl
hasn't received a similar treatment asAlt
?Is access to the state of
ctrl
being worked on?Thanks
The text was updated successfully, but these errors were encountered: