Discussion:
TIL: Korn shell Ctrl-O: submit and stay in history.
(too old to reply)
Kaz Kylheku
2024-07-01 03:42:59 UTC
Permalink
In 2015, I implemented a feature in the TXR Lisp Listener.
While recalling lines from history, you can use Ctrl-X Enter
to run a line, such that it will stay in the history and move
to the next line.

I had not seen this anywhere before that, nor anywhere since;
it was my independent idea.

TIL: GNU Readline introduced this in 2021 as Ctrl-O.

A comment in the code in misc.c says that it's from the Korn shell
(also as Ctrl-O there).

I see in ksh93 sources that it goes at least as far back as 2012,
possibly farther. (On their trunk, it appears in a giant patch bomb
commit from 2012 whose commit message list a huge swath of issues.)
--
TXR Programming Language: http://nongnu.org/txr
Cygnal: Cygwin Native Application Library: http://kylheku.com/cygnal
Mastodon: @***@mstdn.ca
Janis Papanagnou
2024-07-01 08:16:01 UTC
Permalink
First I have to ask what "TIL" means; google search suggests
that it might be "today I learned" - is that what you meant?
Post by Kaz Kylheku
In 2015, I implemented a feature in the TXR Lisp Listener.
While recalling lines from history, you can use Ctrl-X Enter
to run a line, such that it will stay in the history and move
to the next line.
I had not seen this anywhere before that, nor anywhere since;
it was my independent idea.
TIL: GNU Readline introduced this in 2021 as Ctrl-O.
A comment in the code in misc.c says that it's from the Korn shell
(also as Ctrl-O there).
In Ksh it's part of Emacs-mode history editing. (Thus I don't
know it, I'm using Vi-mode editing.)

A very useful command, indeed!
Post by Kaz Kylheku
I see in ksh93 sources that it goes at least as far back as 2012,
possibly farther. (On their trunk, it appears in a giant patch bomb
commit from 2012 whose commit message list a huge swath of issues.)
With Ksh Emacs-editing mode Ctrl-O dates back to at least 1995,
since it's described for ksh93 in the Bolsky/Korn book. I have
no copy of the old version of that book (that describes ksh88),
but the appendix listing feature changes between ksh88 and ksh93
doesn't have it listed as an Editing Change so it might have been
already existing even in ksh88.

Janis

Loading...