gitnow icon indicating copy to clipboard operation
gitnow copied to clipboard

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

Open weichengwu opened this issue 2 years ago • 3 comments

weichengwu avatar May 27 '22 09:05 weichengwu

CleanShot 2022-05-27 at 17 27 40

weichengwu avatar May 27 '22 09:05 weichengwu

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

weichengwu avatar May 27 '22 09:05 weichengwu

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.

joseluisq avatar May 29 '22 19:05 joseluisq

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

patrickfatrick avatar Jan 09 '23 18:01 patrickfatrick

@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.

joseluisq avatar Feb 19 '23 20:02 joseluisq

@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.

patrickfatrick avatar Feb 21 '23 03:02 patrickfatrick

@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.

joseluisq avatar Feb 21 '23 05:02 joseluisq