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

 

22 comments

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

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

 

0

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.

 

2

 I had the same issue.Why not fix it?

0

https://youtrack.jetbrains.com/issue/IDEA-153536 - this seems to be related bug report. Please vote/follow it to receive updates on it's progress

0

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.

11

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

2

~/.inputrc solution did not work for me too

0

~/.inputrc worked great for me on OSX

2

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

0

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

 

0

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

 

0

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.

0

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

0

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"

1

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

0

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

0

This is why PHPStorm's embedded terminal sucks.

1

~/.inputrc works great!Thanks

1

I am using bash on mac and adding the shortcuts inside (newly created) ~/.inputrc helped in my case! Thanx a lot! 

0

For the people using zsh

Add this to ~/.zshrc:

bindkey "\e\eOD" backward-word
bindkey "\e\eOC" forward-word

1

Please sign in to leave a comment.