Skip to content

Default key bindings having uppercase letter do not work on MacOS #29

@samoshkin

Description

@samoshkin

Hi,

PR #16 make it possible to override key bindings for various commands like "diff to merge base", "view log" or "diff to working copy" in a fuzzy finder screens.

However, key binding is now defined with an uppercase letter, e.g. Ctrl-P, Alt-P. IMO, it seems like fzf --bind expects those mappings to be defined in lowercase, like alt-p.

GIT_FUZZY_BRANCH_WORKING_COPY_KEY=${GIT_FUZZY_BRANCH_WORKING_COPY_KEY:-Ctrl-P}
GIT_FUZZY_BRANCH_MERGE_BASE_KEY=${GIT_FUZZY_BRANCH_MERGE_BASE_KEY:-Alt-P}

So the issue is, unless I manually override those environment variables like this with all chars in lowercase, mappings do not work.

export GIT_FUZZY_BRANCH_WORKING_COPY_KEY="ctrl-p"
export GIT_FUZZY_BRANCH_MERGE_BASE_KEY="alt-p"

Regarding local environment I have:

# fzf v0.25.0 (8c533e3)
# zsh 5.8 (x86_64-apple-darwin19.6.0)
# tmux 3.1c
# iTerm2 3.3.7
# MacOS Catalina 10.15.7

Activity

Mellbourn

Mellbourn commented on Feb 9, 2021

@Mellbourn

For me the keybindings doesn't seem to work at all.

I start git fuzzy status and it states that I'm supposed to be able to use Alt-A, Alt-S etc. I'm on a Mac and I've tried substituting Option or Control for Alt but nothing happens.

I can only enter text that filters, use arrows and tab, nothing else works.

# fzf v0.25.1 (brew)
# zsh 5.8 (arm-apple-darwin20.2.0)
# tmux 3.1c
# iTerm2 3.4.3
# MacOS Big Sur 11.2.1

I'm using zinit as package manager, like this

zinit ice wait'2' lucid as"program" pick"bin/git-fuzzy"
zinit light bigH/git-fuzzy

My keyboard is Swedish.

My dotfiles are here https://github.com/Mellbourn/dotfiles

bigH

bigH commented on Feb 13, 2021

@bigH
Owner

this should fix the issue. please update and reopen if this issue persists.

Mellbourn

Mellbourn commented on Feb 13, 2021

@Mellbourn

Didn't fix it for me. Most Alt-keys cannot be triggered by Options key for me. I'm starting to suspect that the issue is related to Swedish keyboard. Maybe this should be a different issue.

pierreguilmin

pierreguilmin commented on Mar 24, 2021

@pierreguilmin

@Mellbourn have you tried #7 (comment)?

Mellbourn

Mellbourn commented on Mar 24, 2021

@Mellbourn
leighmcculloch

leighmcculloch commented on Sep 18, 2021

@leighmcculloch
Contributor

This problem happens for me with the VSCode integrated terminal on macOS. git-fuzzy's keys don't work at all. I don't have this problem with other applications.

bigH

bigH commented on Sep 18, 2021

@bigH
Owner

@Mellbourn sorry for the late response.

I think the problems here are all related to the applications and/or OS hijacking the keys before they end up in the terminal. Option key on the macOS keyboard is not the same as Alt on other platforms. I don't use kitty for this very reason.

Here's what I suggest:

  • try experimenting with different keyboard languages (e.g. switching to the US keyboard) to see if this changes
  • try experimenting with choosing a different terminal emulator; ultimately how they're implemented varies
  • (in vi) try using <C-V> followed by the key-combination you want to check out - this will show you what that key looks like to vim; it's an easy way to debug local issues (e.g. why doesn't something work in terminal emulator X)
  • if all else fails, abandon Option and try remapping the keys
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @leighmcculloch@samoshkin@Mellbourn@bigH@pierreguilmin

        Issue actions

          Default key bindings having uppercase letter do not work on MacOS · Issue #29 · bigH/git-fuzzy