Description
I have tested oksh on a couple of OpenBSD systems as well as this port on Debian (Devuan) and I am having a problem.
I am wondering if it is user error. I thought I might ask here before heading upstream.
Example:
$ oksh
$ set -o vi ; set -o viraw ; set -o posix
$ for I in a b c
do
echo $I
done
a
b
c
So far so good, but:
^[k
$ done
This behavior is unusual, per ksh88, ksh93, and each "commercial POSIX" implementation I have noticed (AIX, HP-UX).
oksh is actually similar to the way GNU Bash works in this case.
$ fc -l
1 set -o vi ; set -o viraw ; set -o posix
2 for I in a b c
3 do
4 echo $I
5 done
Notice how the for loop in history is "split"; each command is on 1 line instead of together.
Compare to the common/classic behavior:
$ for I in a b c
do
echo $I
done
a
b
c
^[k
$ for I in a b c^Jdo^Jecho $I^Jdone
This allows direct command editing and execution of the entire loop within vi, by pressing "v".
$ fc -l
1 set -o vi ; set -o viraw ; set -o posix
2 for I in a b c
do
echo $I
done
Is this "splitting" the "expected" behavior in oksh? If so, is there a way to get the "classic" behavior of ksh88's vi-mode or should I just use a different shell?
Thanks