Alt+key not working in embedded terminal

For instance, ALT+F and ALT+B works in the editor for moving the caret to start of next and previous word respectively. However, in the embedded terminal this is not working - though the chain ESC-ESC-F and ESC-ESC-B provides the same functionality I would really prefer to use the aforementioned.

Is there a way to have ALT+F and ALT+B work in the embedded terminal? Disabling mneumonics does not appear to solve the problem.

PhpStorm 2016.3.2
Ubuntu 16.04



What keymap are you using (alt+f brings File menu by default)?

Do you have Override IDE shortcuts disabled in File | Settings | Tools | Terminal?



I should have mentioned: I am using Emacs keymap.

ALT+F should move the caret to the start of the next word, and ALT+B should move the caret to the start of the previous word, same functionality as CTRL+RightArrow and CTRL+LeftArrow respectively. I'd like to point out that this (ALT+F and ALT+B) works well in the editor, my problem is that I can't get it to work in the embedded terminal.

Override IDE shortcuts in File | Settings | Tools | Terminal is true/checked/active. After your comment I have also tried with Override IDE shortcuts disabled, but it made no difference.



 I had the same issue.Why not fix it?

0 - this seems to be related bug report. Please vote/follow it to receive updates on it's progress


In order to activate ALT-LEFT & ALT-RIGHT in the terminal (as they work in bash), add the following to your ~/.inputrc:

"\e\e[C": forward-word
"\e\e[D": backward-word

and.. reopen the terminal within IntelliJ.


Adding to "~/.inputrc" doesn't work for me.

The only shortcuts working are Esc+B/F that are very uncomfortable.

I managed to have both Opt+B/F and Opt+arrows in iTerm2 and I'd like to have them also in IntelliJ Terminal


~/.inputrc solution did not work for me too


~/.inputrc worked great for me on OSX


@Clarence What version of IntelliJ and OSX are you on?


@Andybergon Sierra 10.12.6 and Webstorm 2017.2.5, before I made the inputrc file alt+left and right would result in [C and [D in the terminal.

Added this file, and opened a new terminal and it worked.



I noticed that Opt+Left/Right add C or D and not [C or [D.

What can cause this? What should I put in the "~/.inputrc" file?

"\e\eC": forward-word
"\e\eD": backward-word



That's curious, for me SHIFT+LEFT and RIGHT add C or D, maybe a keyboard setting?

For example I need to use my fn key to use my top bar controls, e.g. media controls.


@Andybergon, is it possible that it pasted with smart quotes? These nasty quotes aren't called smart for no good reason - they're there to mess with you.


Probably the cause is that I use zsh.
"Zsh does not use readline, instead it uses its own and more powerful Zsh Line Editor, ZLE. It does not read /etc/inputrc or ~/.inputrc"


Any chance you made it work with zsh? I'm stuck with this issue too. 


Nope :V
I am really thinking about going back to bash as I use the terminal in IntelliJ a lot...


This is why PHPStorm's embedded terminal sucks.


Please sign in to leave a comment.