charmbracelet/bubbletea

`[ctrl+enter]` Support

NiloCK opened this issue · 5 comments

I'd like to respond to user input of ctrl+enter differently than enter. This is reasonably common now for various text inputs - eg, with enter doing a \r\n, but ctrl-enter triggering a submit or similar.

Describe the solution you'd like
key.go could provide ctrl+enter as a KeyType?

Hi! Unfortunately, ctrl+enter isn't something historically supported by terminals. #869 will add support for this in some capacity—though keep in mind that if you want to target all terminals everywhere ctrl+enter is not available as a keybinding.

Dang. I had guessed there was a good chance that there was some external limitation here - felt like an unusual omission.

Thanks.

Yep. I'm going to close this as #869 will cover it but feel free to re-open if you feel it's still relevant.

Sounds good @meowgorithm, but a quick followup: does the same constraint apply to shift+enter?

Unfortunately, yes.