Feature Request - PgUp/PgDn Key Support #207
Labels
No Label
blocked
bug
build
documentation
duplicate
enhancement
finger
gemini
gopher
help wanted
http
in progress
invalid
local
needs-info
non-code
non-functional
non-urgent
question
release
rendering
suggestion
telnet
terminal
urgent
wontfix
No Milestone
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: sloum/bombadillo#207
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. 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
u
andd
in the interim. Those could easily be mapped to other single byte keys really easily inclient.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
cui
folder and thetermios
folder. 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.