hangups icon indicating copy to clipboard operation
hangups copied to clipboard

Pick new default keybindings

Open tdryer opened this issue 8 years ago • 6 comments

hangups' current default keybindings were chosen rather arbitrarily. Pick some better defaults. Suggestions welcome!

Related:

  • Some key combinations aren't recognized: #55
  • Vim keybindings: #103
  • Readline keybindings: #131

tdryer avatar Feb 24 '16 04:02 tdryer

My proposal:

key-prev-tab: ctrl p
key-next-tab: ctrl n
key-close-tab: ctrl x
key-quit: meta x
key-menu: ctrl r

None of these conflict with readline keys for text editing. Yes, ctrl p ctrl n ctrl r are used for readline (as many bash users will be familiar with) but they are used for command history which is not something that hangups needs.

  • ctrl p ctrl n were chosen on analogy with GNU screen and tmux previous/next window.
  • ctrl x with a mnemonic of e(x)it window
  • meta x e(x)its the entire program
  • ctrl r mnemonic of (r)ename as this is the only thing it does right now. In the future, no doubt it will do more. Unfortunately ctrl m is not available to use (#55). Maybe meta m?

Some tiling window managers use meta keys for their commands, so maybe it is best to avoid meta? I use a tiling WM but with super as the prefix. I considered ctrl shift x for exiting hangups but this conflicts with a key binding from my terminal (rxvt-unicode). I do think exiting should be a little more difficult so that one does not exit by mistake.

I would certainly be willing to workaround my terminal issue as the binding is for a feature that I don't use.

Another consideration would be to trap ctrl c to take advantage of it to exit cleanly. I find hangups to be very stable and have never needed to kill it.

Lastly, I am an avid vim user, so I would be very interested in a vi-like proposal but I'm not sure how that could be accomplished intuitively without implementing modes.

mrksmrtn avatar Feb 24 '16 19:02 mrksmrtn

+1 for trapping ctrl c. The current keybinding work well enough for me, but I suppose this new proposal is more intuitive. In order to make accidental quitting more difficult, I would suggest that whatever the keybinding, it can only be done from the main menu, and not from a conversation window. But I am not sure that is possible at all.

StuntsPT avatar Feb 24 '16 21:02 StuntsPT

ctrl c is definitely an option for quit and seems like the most intuitive choice.

For preventing accidental quitting: how about using the same key for both close tab and quit, and have closing the conversation list tab quit hangups?

tdryer avatar Feb 25 '16 04:02 tdryer

Sounds good to me.

StuntsPT avatar Feb 25 '16 10:02 StuntsPT

My first thought was that having to navigate to the conversation list to exit would be kind of slow but if you hit it a few times in a row, then you would exit pretty quickly. Maybe we could also add an exit entry to the bottom of the menu in the case where you have a lot of tabs open?

Or maybe we make a binding to switch to a numbered tab (again like screen/tmux)?

mrksmrtn avatar Feb 25 '16 20:02 mrksmrtn

I would really appreciate the option for standard bash keybindings for text editing: c-w, c-a, c-u, and c-e in particular. I use these constantly and they appear in most other terminal apps I use, and not having them makes writing text more cumbersome.

blindstitch avatar Dec 19 '18 18:12 blindstitch