Rocksolid Light

News from da outaworlds

mail  files  register  groups  login

Message-ID:  

BOFH excuse #68: only available on a need to know basis


comp / comp.unix.shell / Re: TIL: Korn shell Ctrl-O: submit and stay in history.

SubjectAuthor
* TIL: Korn shell Ctrl-O: submit and stay in history.Kaz Kylheku
`- Re: TIL: Korn shell Ctrl-O: submit and stay in history.Janis Papanagnou

1
Subject: TIL: Korn shell Ctrl-O: submit and stay in history.
From: Kaz Kylheku
Newsgroups: comp.unix.shell
Organization: A noiseless patient Spider
Date: Mon, 1 Jul 2024 03:42 UTC
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: 643-408-1753@kylheku.com (Kaz Kylheku)
Newsgroups: comp.unix.shell
Subject: TIL: Korn shell Ctrl-O: submit and stay in history.
Date: Mon, 1 Jul 2024 03:42:59 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 21
Message-ID: <20240630203845.599@kylheku.com>
Injection-Date: Mon, 01 Jul 2024 05:42:59 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="e47c07d14565560965ef7c0c5216e68f";
logging-data="969794"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19XjwrJQBYYlIhzTGmlYQkJ7EqSN3sRKHE="
User-Agent: slrn/pre1.0.4-9 (Linux)
Cancel-Lock: sha1:CGnIBwsp2FT21Aeohqql7l1b3uM=
View all headers

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: @Kazinator@mstdn.ca

Subject: Re: TIL: Korn shell Ctrl-O: submit and stay in history.
From: Janis Papanagnou
Newsgroups: comp.unix.shell
Organization: A noiseless patient Spider
Date: Mon, 1 Jul 2024 08:16 UTC
References: 1
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: janis_papanagnou+ng@hotmail.com (Janis Papanagnou)
Newsgroups: comp.unix.shell
Subject: Re: TIL: Korn shell Ctrl-O: submit and stay in history.
Date: Mon, 1 Jul 2024 10:16:01 +0200
Organization: A noiseless patient Spider
Lines: 36
Message-ID: <v5tok2$107ku$1@dont-email.me>
References: <20240630203845.599@kylheku.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=windows-1252
Content-Transfer-Encoding: 7bit
Injection-Date: Mon, 01 Jul 2024 10:16:03 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="97c7a9a36948d3f0df5e998339a9ced9";
logging-data="1056414"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18NKvCZhtEzPczIJIK/P6FZ"
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
Thunderbird/45.8.0
Cancel-Lock: sha1:VzmntH55w6q1+3HNgRJ/ALFYYKM=
X-Enigmail-Draft-Status: N1110
In-Reply-To: <20240630203845.599@kylheku.com>
View all headers

First I have to ask what "TIL" means; google search suggests
that it might be "today I learned" - is that what you meant?

On 01.07.2024 05:42, Kaz Kylheku wrote:
> 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!

>
> 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

1

rocksolid light 0.9.8
clearnet tor