Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VS Code Terminal Won't Map Option Key to Meta

I am trying to enable the option/alt key as Meta in my terminal in VS Code. I set the "terminal.integrated.macOptionIsMeta": true in my settings.json but it is not working.

I made this same change to my system Terminal app and iTerm2.

iTerm is the only one that works. In iTerm the option key is mapped to Meta but not in the VS Code terminal or Terminal.

Does anyone know why this could be or how to correct it?

OS X 10.15.7
VS Code Version: 1.63.2
iTerm2 Build 3.4.12
Terminal Version 2.10 (433)

VS Code

enter image description here

enter image description here

iTerm2 enter image description here

Terminal

enter image description here

like image 725
Casey Avatar asked Oct 18 '25 02:10

Casey


1 Answers

This appears to be an issue with how OS X handles tmux-keyboard integration, not VS Code.

The relationship between Option/Alt and Esc/Meta does not work well. Even if this feature is enabled in your terminal emulator. Consequently, when binding the Meta+ to an action in .tmux.conf the resulting behavior is not as expected.

bind -n M-j select-pane -L
bind -n M-k ​select-pane -R

Alt+j and Alt+k work as expected.

However, when binding the Meta+[DirectionKey]:

bind -n M-Left select-pane -L
bind -n M-Right select-pane -R

Alt+Left and Alt+Right do NOT work and you need to use Esc+Left and Esc+Right.

like image 68
Casey Avatar answered Oct 21 '25 06:10

Casey



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!