joseluisq / gitnow

Speed up your Git workflow. :tropical_fish:
https://github.com/joseluisq/gitnow
MIT License
391 stars 25 forks source link

Why `Option+RightArrow` triggers `Creates a new feature (Gitflow) branch from current branch.` in vscode terminal? #47

Closed weichengwu closed 1 year ago

weichengwu commented 2 years ago

CleanShot 2022-05-27 at 17 27 40

weichengwu commented 2 years ago

My VSCode keyboard shortcuts settings: CleanShot 2022-05-27 at 17 29 35

joseluisq commented 2 years ago

I don't have any idea. You can always change that shortcuts with your own.

But please provide more context and info like OS, Fish, Gitnow versions.

patrickfatrick commented 1 year ago

I ran into this recently with the bultin mac terminal app. I believe it's because of the option "Use Option as Meta key" (and I believe many shells on mac use this behavior by default), and the escape sequence to move forward a word in bash is Meta + F (Meta + B triggers the sequence to go back a word), so now you can do Option + F to move forward. Option + -> is a common key binding on top of this behavior

With gitnow, Option + F does something different, but Option + -> triggers it due to the keybinding, so rather than move forward one word, it instead triggers the gitnow Option + F keybinding.

Hope that makes sense.

More info: https://www.shell-tips.com/mac/meta-key/#gsc.tab=0

joseluisq commented 1 year ago

@weichengwu I was playing around a bit and for some reason, if you enter fish_key_reader in your VSCode terminal and then type Option+RightArrow then you will get bind \ef 'do something' (\ef is the keybinding for creating a feature branch). BUT if you try the same in another terminal, let's say Iterm2 then you will get bind \e\e\[C 'do something' (right behavior).

So I have no idea why that happens on VSCode but I assume that it is something specific to the VSCode terminal. I will close this issue since it is not something about Gitnow but more about terminal key settings. Feel free to open it again if it's needed.

patrickfatrick commented 1 year ago

@joseluisq It happens for me in Terminal as well, so it's not specific to VSCode. See https://github.com/joseluisq/gitnow/issues/47#issuecomment-1376109219. That said it's easy to change gitnow's keybindings so I'm not sure it needs a change.

joseluisq commented 1 year ago

@joseluisq It happens for me in Terminal as well, so it's not specific to VSCode. See #47 (comment). That said it's easy to change gitnow's keybindings so I'm not sure it needs a change.

Sorry, I missed your comment. Yeah then it is more like terminal apps settings or gitnow keybindings setup in general.