How do I get Jetbrains IDE's embedded terminal to recognize ALT/Option as the Meta key?
Asked Answered
F

3

20

I'm currently working in WebStorm, but also use IDEA and RubyMine. I am using the embedded terminal and would like to get the Alt/Option key to be recognized as a the meta key, or at least send key+ESC.

Froward answered 14/10, 2014 at 16:53 Comment(0)
F
1

Now that I have moved to zsh and have more experience with this issue. Here is what I have in my .zshrc file:

### Jetbrains terminal
if [[ "$TERMINAL_EMULATOR" == "JetBrains-JediTerm" ]]; then
  bindkey -s "µ" "^E | less ^M" # Personal Alt-M shortcut
  bindkey "ƒ" forward-word
  bindkey "∫" backward-word
  bindkey "∂" kill-word
  bindkey "¬" downcase-word
  bindkey "ç" capitalize-word
  bindkey "†" transpose-words
  bindkey "≥" insert-last-word
  # bindkey "¨ " upcase-word
fi

Check out zsh list of standard Widgets

Froward answered 6/5, 2021 at 23:24 Comment(0)
M
5

For macOS users, put these in ~/.inputrc for Bash:

"ƒ": forward-word "∫": backward-word "≥": yank-last-arg "∂": kill-word

And other simple meta key bindings can be defined here. (Unless you use ƒ and ∫ more often.) Note this only works in local shells, not in remote SSH shells.

Ref: https://youtrack.jetbrains.com/issue/IDEA-165184#focus=streamItem-27-1955537-0-0

Mercurous answered 14/8, 2018 at 7:10 Comment(3)
Not a complete solution, but since these are the two most used meta-key... works for me.Froward
"∂": kill-word is useful too (ALT+D to delete next word). man bash to see more commands (search for (M- which means Esc+ and see what shortcuts you want to rebind in .inputrc)Kingwood
@Kingwood definitely worth adding.Mercurous
F
1

Now that I have moved to zsh and have more experience with this issue. Here is what I have in my .zshrc file:

### Jetbrains terminal
if [[ "$TERMINAL_EMULATOR" == "JetBrains-JediTerm" ]]; then
  bindkey -s "µ" "^E | less ^M" # Personal Alt-M shortcut
  bindkey "ƒ" forward-word
  bindkey "∫" backward-word
  bindkey "∂" kill-word
  bindkey "¬" downcase-word
  bindkey "ç" capitalize-word
  bindkey "†" transpose-words
  bindkey "≥" insert-last-word
  # bindkey "¨ " upcase-word
fi

Check out zsh list of standard Widgets

Froward answered 6/5, 2021 at 23:24 Comment(0)
C
0

All related to the terminal configuration is here: IntelliJ Embedded Terminal

It looks like IntelliJ is just an interface and calls the system's terminal (or whatever you configure in the Shell Path option). So it's not up to IntelliJ but to the shell you are calling to be configured correctly.

So check what shell is IntelliJ calling, and then check if the key is working there (without calling it through IntelliJ).

Chitkara answered 15/10, 2014 at 18:45 Comment(5)
I'm on a Mac. Both Terminal & iTerm have an option to map the ALT key to ESC+.Froward
So If I'm understanding, the meta key works on both Terminal and & iTerm but when embedded in the IntelliJ the key is not responding?Chitkara
Yes, I believe Terminal & iTerm have settings that enable this functionality, but Jetbrains embedded terminal does not. It may simply not be possible. I was hoping it was.Froward
just checking to see if this is still an issueEmaciated
It is, bothers me too.Landgraviate

© 2022 - 2024 — McMap. All rights reserved.