All of that said, I am a huge proponent of the kitty keyboard protocol. I would love to live in a world where the "default" encoding of keys is done with the that protocol (with the disambiguate flag on)
Right, I read that the other way round ("no, you do need terminfo for key input")!
For basic input it's fairly straight-forward, and even for various "special" keys like arrows and function keys it's not too bad: just check from a list.
But with modifier keys it gets more tricky; lots of that isn't even in terminfo and requires "special" handling.
If you know how this works and you know what you're doing it can be fine, but for most people it's far easier to just use a terminfo library that does this for you.
And yeah, Kitty keyboard protocol being the default would be brilliant. Right now support is (far) too flaky though, so maybe in 5 to 10 years.
> Key input handling is kind of a mess, and this is where I really recommend using a terminfo library if at all possible. This also avoids the whole backspace/delete key confusion (less of an issue today than it used to be, but still exists).
Of course lots of applications don't use backspace or delete; sometimes you just want the ability to select between 3 items with j/k and arrow keys, or something like that. And if this is something just for yourself or a limited audience then it's fine to just read that from stdin and not worry too much.