Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In Terminal.app, option+arrow keys no longer move by word

Having done a little research on this, I know that option+left arrow and option+right arrow do not by default move by word in the OS X Terminal application. But mine did, until about a week ago.

The only thing that's changed is oh-my-zsh updated. I see that it has

bindkey "^[[1;5C" forward-word  
bindkey "^[[1;5D" backward-word

defined but I don't know what those keys are. GitHub's last recorded change to the file was 24 days go and not related to those keys, so this must predate the latest update.

I have also tried the "Use option as meta key" option under Preferences > Settings > Keyboard. That only results in printing [D and [C when I hit option+left arrow and option+right arrow.

like image 288
ele Avatar asked Dec 27 '13 15:12

ele


1 Answers

One way to fix your issue is to:

  • In Terminal.app > preferences > Settings > Keyboard there's a Key -> Action list.
  • In that list find or add option cursor left and option cursor right and set their values to \033b and \033f respectively.
  • Quit and restart Terminal.app
like image 163
rdodev Avatar answered Nov 08 '22 23:11

rdodev