From: Diomidis Spinellis <dds@aueb.gr>
To: TUHS main list <tuhs@tuhs.org>
Subject: [TUHS] vi in cooked mode?
Date: Thu, 3 Nov 2022 21:43:44 +0200 [thread overview]
Message-ID: <7b249e68-de74-2c81-32b0-18ecb74a85ec@aueb.gr> (raw)
I remember being told back in the 1980s that vi would set the terminal
to "cooked mode" when vi was in "insert mode", so as to reduce expensive
context switching for each character typed. Only vi's "command mode"
would set the terminal to "raw mode" so as to provide immediate feedback
on each (command) character typed. This would be a clever system
performance optimization, and would also explain designing vi around
distinct insert and command modes.
However, I can't find such evidence even as far back as BSD 1. It seems
that in insert mode ESC was processed like any other character.
https://github.com/dspinellis/unix-history-repo/blob/BSD-1-Snapshot-Development/ex-1.1/ex_vops.c#L507
Cooked mode was only entered when scrolling in order to receive interrupts.
https://github.com/dspinellis/unix-history-repo/blob/BSD-1-Snapshot-Development/ex-1.1/ex_vadjust.c#L180
Also, for this scheme to work ESC would need to be mapped to an
interrupt key, so as to allow exiting the cooked mode through the
corresponding signal handler. Again, grepping for ESC, did not show me
any such code.
I also remember being told that this optimization was what allowed
twenty students to concurrently perform interactive editing on a VAX
11/780 (running 4.2BSD and then 4.3BSD), and that Emacs was not provided
to students because it was always operating in raw mode.
Was I misled? Was there perhaps a hacked version of vi that worked in
this way?
-Diomidis
next reply other threads:[~2022-11-03 19:44 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-03 19:43 Diomidis Spinellis [this message]
2022-11-03 20:26 ` [TUHS] " Clem Cole
2022-11-03 20:27 ` Clem Cole
2022-11-03 20:55 ` Warner Losh
2022-11-03 21:34 ` Clem Cole
2022-11-03 22:28 ` Warner Losh
2022-11-03 22:52 ` Ron Natalie
2022-11-04 6:43 ` Lars Brinkhoff
2022-11-04 15:18 ` Dan Cross
2022-11-04 17:54 ` Lars Brinkhoff
2022-11-04 18:33 ` Ron Natalie
2022-11-04 23:42 ` Theodore Ts'o
2022-11-05 0:45 ` Dave Horsfall
2022-11-05 1:02 ` Larry McVoy
2022-11-05 1:25 ` Bakul Shah
2022-11-05 1:40 ` Larry McVoy
2022-11-05 2:31 ` Rich Salz
2022-11-05 3:44 ` Bakul Shah
2022-11-05 18:34 ` Theodore Ts'o
2022-11-05 9:29 ` Otto Moerbeek via TUHS
2022-11-04 22:13 ` Mary Ann Horton
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=7b249e68-de74-2c81-32b0-18ecb74a85ec@aueb.gr \
--to=dds@aueb.gr \
--cc=tuhs@tuhs.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).