On my Debian systems, I have always used
pdksh as my interactive shell. Originally, command-line history behavior was similar to what I grew up with on platforms like AIX and Solaris.
pdksh on Debian is now implemented by
mksh, command-line history no longer works like my fingers expect. I am trying to figure out if I can configure
mksh to do what I want, or if I have to find another idiom (or another shell).
ksh in vi-editing mode (
set -o vi and
FCEDIT=vi). Quite often, I write short multi-line commands immediately at the command prompt, i.e.
daystrom:/home/pronovic> for i in 1 2 3 > do > print $i > done 1 2 3
These work as expected in
mksh. However, command-line history does not.
In all of the kshell implementations that I am familiar with (prior to now), this script would be preserved in the history as a single entry. So, I could hit
ESC-k and go back to the front of the
for line. Once I got there, I could edit the script in place again, or I could hit
ESC-v to edit the script in
mksh, each line in my script (the
for line, the
do line, the
ESC-k just takes me to the
ESC-k again takes me to the
I am looking for a way to configure
ESC-k takes me to the beginning of my script so I can execute it or edit it again. However, I haven't found a way to do this.
The only discussion I have found is on gmane, which implies that
^O can somehow be used. However, it's not clear to me how that is relevant -- or maybe it's just not relevant in vi-editing mode.
Is it possible to make this work?