Sujet : Re: Shell command history (was: Useless Use Of Regexes)
De : ldo (at) *nospam* nz.invalid (Lawrence D'Oliveiro)
Groupes : comp.os.linux.miscDate : 12. Apr 2025, 07:55:05
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <vtd2o9$3ri7f$1@dont-email.me>
References : 1 2 3 4 5 6 7 8 9
User-Agent : Pan/0.162 (Pokrosvk)
On Wed, 9 Apr 2025 13:26:48 +0100, Geoff Clare wrote:
On 4/8/25 9:16 PM, Lawrence D'Oliveiro wrote:
>
On Tue, 08 Apr 2025 15:39:47 +0300, Anssi Saari wrote:
The only time I've had to use vi command history editing was with
some old version of VxWorks. It was the only kind included by
default. I ended up teaching some colleagues on how to edit the
command line, vi style.
Seems a bit dumb, having to go into insert mode every time you
actually want to type a command.
That's not how it works.
But that’s how the vi/vim editor family works. Are you saying that a
command-line editor that is supposed to work like those editors doesn’t in
fact, emulate them entirely faithfully?
After the shell writes a command prompt, it is
in insert mode, so you just type a command as normal. To edit the
current command, or search the history, you type ESC to get out of
insert mode and then perform the edit or search just like in vi (except
that RETURN executes the edited command instead of moving to the next
"line").
Seems like a lot of unnecessary back-and-forth.
It became an IEEE standard in 1992 (and ISO in 1993) for
POSIX-conforming shells, and has remained standard to this day. IEEE
chose not to include emacs mode, so effectively it is emacs mode that
was treated as obsolete (in 1992).
Nevertheless, that is the one that is most commonly used in *nix systems
today.