Feature Request - PgUp/PgDn Key Support
Openopened 2 years ago by demure · 1 comments
Reference in New Issue
There is no content yet.
Delete Branch '%!s(<nil>)'
Deleting a branch is permanent. It CANNOT be undone. Continue?
Can some default bindings be added for PgUp/PgDn keys?
I find these keys indispensible when using cli programs, and it would be nice if bombadillo used them as well.
Sadly, Golang does not provide any form of get key functionality and Bombadillo has a strict policy of not using third party libraries. As a result we have rolled our own get key functionality. Due in part to being a vi keybinding oriented client we did not add parsing for multibyte keys (ctrl+key, arrows, pgup/down, etc). I wont say never, but I do not see this changing any time soon.
You can access page up and down functionality with
din the interim. Those could easily be mapped to other single byte keys really easily in
client.go's main input loop if you would like a different single byte binding.
I have resisted remappable keys for Bombadillo, but maybe it is time to consider that as something to offer (though it would still only offer single byte keys). My development time is slim (I have a 2 year old), but I will add remapping to my eventual to do list.
I would definitely be open to a pull request with multibyte input parsing for getKey (that does not involve a third party lib). If you were interested in taking a shot at it the relevant code would be in the
cuifolder and the
termiosfolder. The termios would need to be set with a short timeout on keypress and the cui code for get key would need to read multiple and be able to accept null read. I know it can be done in go, but I'm not sure how to do it (I could do it in C, but don't want to drop to cgo).
Sorry for the longwinded answer, but I did want to fully consider the request and respond with my thoughts on it.