Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
samoshkin opened this issue Jan 15, 2021 · 7 comments
Closed

Comments

@samoshkin
Copy link

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
@Mellbourn
Copy link

Mellbourn commented Feb 9, 2021

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
Copy link
Owner

bigH commented Feb 13, 2021

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

@bigH bigH closed this as completed Feb 13, 2021
@Mellbourn
Copy link

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
Copy link

@Mellbourn have you tried #7 (comment)?

@Mellbourn
Copy link

Mellbourn commented Mar 24, 2021 via email

@leighmcculloch
Copy link
Contributor

leighmcculloch commented Sep 18, 2021

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
Copy link
Owner

bigH commented Sep 18, 2021

@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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants