Bug#783978: mksh: Support command-line history for multi-line commands
Package: mksh
Version: 50d-5
Severity: wishlist
Tags: upstream
Recently, since pdksh on Debian is now implemented by mksh, command-line
history no longer works like it used to several years ago.
I use 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.
Previously, 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 vi.
In mksh, each line in my script (the for line, the do line, the print
line, etc.) ends up as a separate entry in my history. So, ESC-k just
takes me to the done line, ESC-k again takes me to the print line, etc.
I started a discussion on stackexchange:
http://unix.stackexchange.com/questions/199766/is-it-possible-to-get-working-history-for-multi-line-commands-in-mksh-using-vi
In that discussion, mirabilos says that this behavior can be improved.
I am submitting this Debian bug to track the request.
Thanks,
KEN
-- System Information:
Debian Release: 8.0
APT prefers stable-updates
APT policy: (500, 'stable-updates'), (500, 'stable')
Architecture: i386 (i686)
Kernel: Linux 3.16.0-4-686-pae (SMP w/1 CPU core)
Locale: LANG=en, LC_CTYPE=en_US (charmap=ISO-8859-1) (ignored: LC_ALL set to en_US)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
Versions of packages mksh depends on:
ii libc6 2.19-18
mksh recommends no packages.
Versions of packages mksh suggests:
ii ed 1.10-2
-- no debconf information
Reply to: