Skip to content

Custom binding for key p is ignored when a commit has focus (behaviour reverts to pull) #4614

@stephenmartindale

Description

@stephenmartindale

Describe the bug

User customisation of the keybinding for p (lowercase) – i.e. using p for another action or unbinding p by mapping it to <disabled> – is ignored when the commit log is active.

Instead of obeying the user's keybindings, lazygit falls back to the default built-in behaviour which appears to be git pull --no-edit.

To Reproduce

  1. Customise the key map, thus:

    keybinding:
      universal:
        pushFiles: <disabled>
  2. In lazygit, focus the commit log and have a commit in the list selected.

  3. Strike p (lowercase, no modifiers)

  4. Observe that lazygit falls back to git pull --no-edit which is not the configured behaviour.

  5. Change to the branches, remotes or tags pane and try striking p; observe that lazygit obeys its configuration.

Expected behavior

lazygit should heed user keybinding preferences – consistently – throughout the U.I.

Version info:

commit=, build date=, build source=unknown, version=0.51.1, os=linux, arch=amd64, git version=2.49.0

Additional Details

  • If the commits window is not active (another lazygit pane has focus) then it appears that p will behave as configured.

  • Mapping p to another action appears to exhibit the same incorrect behaviour. For example, I discovered this issue because I wished to swap p and P (to be push and pull, respectively, instead of the default) but this is presently impossible because the following does not work, consistently:

    keybinding:
      universal:
        pullFiles: p
        pushFiles: P
    • but this config does work for the branches pane, remotes or tags, too.
  • The mapping for branches: pushTag: appears to have no bearing on this behaviour and mapping that to <disabled> does not resolve the issue. (grep found no other mentions of push or pull in the default keybindings as far as I could tell.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions