gitui icon indicating copy to clipboard operation
gitui copied to clipboard

hjkl bindings don't work m1 mac 12.4

Open theherk opened this issue 3 years ago • 0 comments

Describe the bug

After enabling the key configuration as noted in the documentation, I am still unable to use hjkl to navigate. There is another similar issue #1202, but I have verified that my configuration should be correct.

To Reproduce

  1. Create file ~/.config/gitui/key_bindings.ron with below contents.
  2. Run gitui

Navigation is still with arrows and hjkl has no effect.

~/.config/gitui/key_bindings.ron

(
    focus_right: Some(( code: Char(l), modifiers: ( bits: 0,),)),
    focus_left: Some(( code: Char(h), modifiers: ( bits: 0,),)),
    focus_above: Some(( code: Char(k), modifiers: ( bits: 0,),)),
    focus_below: Some(( code: Char(j), modifiers: ( bits: 0,),)),
    
    move_left: Some(( code: Char(h), modifiers: ( bits: 0,),)),
    move_right: Some(( code: Char(l), modifiers: ( bits: 0,),)),
    move_up: Some(( code: Char(k), modifiers: ( bits: 0,),)),
    move_down: Some(( code: Char(j), modifiers: ( bits: 0,),)),

    open_help: Some(( code: F(1), modifiers: ( bits: 0,),)),
)

Expected behavior

hkjl move cursor and selections as arrows do.

Context (please complete the following information):

  • OS/Distro + Version: m1 mac os Monterey 12.4
  • GitUI Version: 0.20.1
  • Rust version: 1.62.0
  • installed via brew
  • wezterm 20220408-101518-b908e2dd

theherk avatar Jun 08 '22 09:06 theherk

Key bindings Char codes use a char type (i.e. quote marks). This works:

(
    focus_right: Some(( code: Char('l'), modifiers: ( bits: 0,),)),
    focus_left: Some(( code: Char('h'), modifiers: ( bits: 0,),)),
    focus_above: Some(( code: Char('k'), modifiers: ( bits: 0,),)),
    focus_below: Some(( code: Char('j'), modifiers: ( bits: 0,),)),
    
    move_left: Some(( code: Char('h'), modifiers: ( bits: 0,),)),
    move_right: Some(( code: Char('l'), modifiers: ( bits: 0,),)),
    move_up: Some(( code: Char('k'), modifiers: ( bits: 0,),)),
    move_down: Some(( code: Char('j'), modifiers: ( bits: 0,),)),

    open_help: Some(( code: F(1), modifiers: ( bits: 0,),)),
)

remique avatar Aug 17 '22 10:08 remique

Wow. I always mess up some mundane detail. :) Thank you. Works like a charm.

theherk avatar Aug 17 '22 11:08 theherk