In OS X ipython shell navigation was a pain coz I couldn't navigate/skip one word forward or backward using CTRL-RIGHT / LEFT arrows. Whenever I tried doing it I would see such characters.

In [1]: celery papaya;5D;5D;5D;5C;5C;5C

A QUICK WAY TO FIX this is by installing readline and configuring .inputrc.

1) Install readline using brew

$ brew install readline

2) TRICK LIES HERE. Find which characters are sent to ipython notebook when you press CTRL-RIGHT / LEFT.

Press CTRL-V and CTRL-RIGHT. In my case it showed

^[[1;5D

REPEAT for left arrow. Press CTRL-V and CTRL-LEFT.

^[[1;5C

3) Finally, your ~/.inputrc should look like

$ cat ~/.inputrc # ipython settings "\e[1;5D": backward-word "\e[1;5C": forward-word

4) Enjoy ! CTRL-RIGHT and CTRL-LEFT works now.

Some References:

https://cnswww.cns.cwru.edu/php/chet/readline/readline.html#SEC14