Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

oksh not compliant with ksh88 vi-editing mode? #64

Open
kajukenbo opened this issue Oct 10, 2021 · 0 comments
Open

oksh not compliant with ksh88 vi-editing mode? #64

kajukenbo opened this issue Oct 10, 2021 · 0 comments

Comments

@kajukenbo
Copy link

kajukenbo commented Oct 10, 2021

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant