Fork me on Github
Fork me on Github

Joe Dog Software

Proudly serving the Internets since 1999

up arrow esc-esc completion

Your JoeDog loves himself some esc-completion. For years he carried around his own personal copy of pdksh because it supported that feature. Unfortunately, pdksh hasn’t been updated in years. That’s an exploit waiting to happen. By happy chance, most Linux distributions provide mksh now. That supports esc completion. To enable it, set this directive in $HOME/.profile

set -o vi-esccomplete

With that feature enabled, life is grand and you’re esc-completing all over the place … until you reboot your laptop. The gnome login doesn’t care for vi-esccomplete one bit. No, sir.

set: vi-esccomplete: invalid option name

To get around this problem, you can check to see if $HOME/.profile is invoked with a tty. It will then be read when you open a terminal but ignored when you log in to your laptop:

if [ -t 1 ]; then # only run this if you have a tty
set -o vi-esccomplete
fi

Happy esc-completing.