Why `Option+RightArrow` triggers `Creates a new feature (Gitflow) branch from current branch.` in vscode terminal?
weichengwu opened this issue · 7 comments
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.
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
@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 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.
@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.