Gripe: Use Ctrl-D (i.e. EOF) to exit

Mike Maxwell maxwell at ldc.upenn.edu
Tue Feb 24 09:25:46 EST 2004


Peter Hansen wrote:
> ctrl-D 4   EOT   END OF TRANSMISSION
> A transmission control character used to indicate the conclusion of
> the transmission of one or more texts..
>
> Why anyone would think that ought to be translated as "down" rather
> than "I'm done, bye" is unclear to me.

To this and other comments along this line, I'll just add my own (not trying
to start a flame war, just explaining what may seem an odd choice on my
part):

IMHO, there's an unfortunate juxtaposition (I won't say confusion) of two
meanings of Ctrl-D: one is the ASCII char (as above), the other is whatever
is produced by pressing the 'd' key while the key labeled 'Ctrl' is pressed.

On Lisp Machines (and if you're too young to know what those were, you're
too young), there was a whole set of special purpose keys, including a Meta
key and a Hyper key.  Their effect was similar to the Ctrl or Shift keys, in
that they modified the output of an "ordinary" key.  Most keyboards nowadays
come with an Alt key, which could be used for what I want (move the cursor
down 7 rows, or scroll half a screen, or whatever), except that it has a
different function.  And since there is no Meta or Hyper key on my keyboard,
I use the key to the left of the 'A' key (easy to reach both that and all
the alphabetic keys at the same time) as a key modifier, to do cursor
movement (^A = beginning of line, ^H = left one char, etc.).  It happens
that that modifier key is labeled "Caps Lock" on most modern keyboards.
Under Linux, I can re-map it to a special modifier key, which does not then
interfere with using the Ctrl key to produce the Ascii control chars, so I
can use ^D to kill Python.  But it's not so easy to re-map it under Windows,
and the only alternative seems to be to re-map it to be the Ctrl key.  (And
don't say that I should just use Linux--the range of standardized cursor
movement keystrokes is _far_ greater under Windows than it is under Linux
environments that I've seen.)

So the upshot of it is, I want to have a keystroke to move down a half dozen
lines _much_ more often than I want one to exit a program.  And my fingers
know Ctrl-d.

I might also point out that one can use other modifiers at the same time as
the Ctrl, e.g. Ctrl-Shift-D on my keyboard selects text for seven lines
down.  There is obviously no Ascii equivalent of this, but it's a useful
keystroke.

Peter Hansen also wrote:
> Interesting... so God didn't write the ASCII standard, obviously

No, He used Hebrew.  Duh.  (I might also point out that the Hebrew alphabet,
lacking a case distinction, would fit nicely into a 6-bit encoding, as was
used on the CDC Cyber 170 that I wrote my dissertation on.  You don't know
what a Cyber 170 is?  You _are_ too young!)

    Mike McSwell







More information about the Python-list mailing list