Digital Consumption


 Charles Darke | 2 June 2007
Instead of doing something constructive, today, I decided to battle with my shell. I use ksh on OpenBSD and I want to achieve something relatively simple:
  1. Be able to use the tab key for file and directory completion;
  2. Be able to use the up and down cursor/arrow keys to go through the command line history; and
  3. Be able to edit the command line using vi.
Since OpenBSD does (1) and (2) by default, I thought I was pretty much in the clear. The ksh man page gives:
vi

Enable vi(1)-like command-line editing (interactive shells only).

vi-esccomplete

In vi command-line editing, do command and filename completion when escape (^[) is entered in command mode.

vi-tabcomplete

In vi command-line editing, do command and file name completion when tab (^I) is entered in insert mode. This is the default.

So it looks like a no brainer:

set -o vi

and vi command line editing should work. Well it does, but for some reason it disables feature (2), cursor keys for history.

Now, I can work around this a little by pressing ESC and then using 'j' and 'k' keys to go through the history, but I'd rather avoid this extra key press and my finger memory is already used to using the arrow keys.

Anyone got a solution? 


Comments (0)

No comments yet: be first to add comments to this topic!