In praise of ⌘


Control-C is the intr character in Unix.  It sends SIGINT to the currently running process, thereby interrupting it.  Most programs either quit or return to an interactive prompt when they receive this signal.

Control-C is the Copy command in Windows.  It copies the highlighted text (or other graphic objects) to the clipboard.

What do you do when you’re using a terminal emulation program on Windows to connect to a Unix computer?  Does pressing Control-C send a Control-C character to the Unix system, or does it copy the highlighted text to the clipboard?  I have no idea (it’s been a long while since I used a terminal emulator on Windows), but one thing is clear: It’s not clear what the right answer is.

On a Mac Copy is an example of a command to a GUI application.  Keyboard shortcuts are accessed using the Command key.

Command Key

Command Key from wikimedia

This is a stroke of genius.

Now, when using a terminal emulation program on a Mac, it’s completely obvious what happens. Control-C sends a Control-C character to the Unix system, which will interpret it as intr. Command-C copies the highlight text to the clipboard.

Was this luck? Hard to tell, but I think not. The Mac was conceived as an entire product. It therefore seems completely reasonable to design a keyboard just for that product, and completely reasonable to create a new key for doing Mac things. Windows was conceived as an operating system. It had to run on existing hardware.

Why didn’t Apple just stick a Control key on the keyboard and use that? Well, that would have been silly, and difficult to explain. Control had an existing use (on a terminal to send control characters that generally affected either the connection or the movement of the print head) which had nothing to do with GUI commands. Better to name the key that is used for keyboard shortcuts for GUI commands, Command.

Why didn’t Windows do this? Microsoft weren’t in a position where they could dictate what keys appeared on the keyboard. They had to make do with whatever was there. Why Control-C for Copy instead of Alt-C, say? I have no idea. It seems particularly mysterious since, at the time Windows was layered on top of DOS and so was used by people familiar with DOS and in DOS, at least at the command prompt, Control-C meant interrupt, like it does in Unix.

The lucky bit seems to be that Apple ever put a Control key on the keyboard at all; early keyboards didn’t have one, but I guess as soon as you have a modem you can connect to some other computer and that will require a Control key for some things. But basically the Control key on a Mac hung around for 2 decades doing nothing much until OS X comes out and then it’s used in all the traditional Unix ways.

What did Unix do when it got a window system? Well, on X Windows in the mid nineties I don’t remember using a keyboard shortcut for Copy. In fact, I don’t remember using Copy at all. The middle mouse button (most Unix workstations and X servers of the time had mice with 3 or more buttons) would paste the highlighted text into whichever window the mouse was pointing at (note: the highlighted text could be in a different window from the one which receives the pasted text). No separate Copy command, just highlight text in one window, and click middle button to paste it into another window. Cute.

Windows has a Windows button now (and, much to my surprise has had it since Windows 95). Obviously there was no way that Copy could be moved from Control-C to Windows-C because Control-C was already welded into the minds of all Windows users. So the Windows button generally does useless things in Windows.

What about Ubuntu? They could’ve decided that it was reasonable to assume that all keyboards would have the Windows key. They could’ve decided that all GUI shortcut commands would use the Windows key. Freeing up Control-C to mean intr. You would’ve though that for a GUI running on Unix this would be an important consideration. But no, Ubuntu thoughtlessly copies windows and Control-C means Copy. Unless you’re in the terminal emulator, Terminal, in which case it sends a Control-C character and you have to remember to use Shift-Control-C for Copy. And just like Windows, the Windows key is useless in Ubuntu.

It all just seems like a lost opportunity to me.


21 Responses to “In praise of ⌘”

  1. glorkspangle Says:

    Linux distros like Ubuntu are trying to be usable. Most people have control-C = Copy welded into their minds. This is regrettable for all the reasons you point out, but not something which Linux distro makers can fix or should try to fix. I guess the people making or configuring terminal emulators for *nix could make alt-meta-cokebottle-C send an 0x03 byte. I mean, the control key ultimately, like the cmd key and the Windows key, is just a piece of plastic. Unix doesn’t care what gesture you used to make ETX.

  2. glorkspangle Says:

    Also, the Windows key was pretty irritating for about a decade, but I use it every day (because generally keybindings for stupid-rat-thing-gestures are a good thing).
    Also also, for some reason all my logins are fucked up now.

  3. Was middle button the default? I forget. I remember not liking it and I’m sure that at least one window manager didn’t do it that way, or mandate it being done that way.

    I vaguely recall rebinding everything so that there was an express cut/paste set of keys. In part because I wanted to have the same experience as using a mac and partly because I didn’t always have a middle button available.

    This meant a tour-de-force of understanding how to set resources regardless of what architecture one was using (server and client and window manager possibly being on several machines) and understanding how broken everything was. Fun, distracting, days.

    • drj11 Says:

      Effectively impossible to say what the default was. No-one used X11R5 out of the box, so you’d get settings based on whatever was installed on that unix box, and whatever scripts you’d cribbed from your mates.

      But yes, I too have far too many memories of configuring everything at every level just to get things “just so”.

      • Yes, I think I started with a Motif Window Manager which I think *didn’t* work that way, and I preferred to stay with that behaviour rather than move. It had click to focus and didn’t capture your mouse when it created a new window – all of which I preferred at the time.

  4. ljosa Says:

    You forget that early versions of Windows used Ctrl-Insert for copy and Shift-Insert for paste, as prescribed by IBM’s Common User Access (CUA) standard. I wonder if they still work on new Windows versions?

    • drj11 Says:

      I never knew that. Shame that didn’t catch on.

      • Francis Irving Says:

        They do still work. I learnt them and used them all the time when I used Windows. They were much more fun than the Ctrl+CXV. I can’t justify why, maybe it just gave me a sense of superiority.

  5. mjb67 Says:

    In response to “What do you do when you’re using a terminal emulation program on Windows to connect to a Unix computer?”: same as using the command shell (cmd.exe) on a Windows computer. Ctrl-C is always interrupt in a Windows command shell, same as it was on DOS. Modernfangled “copy” is only for Windows applications.

    • I vaguely recall pressing Alt-Space to bring up the window menu on the Windows command shell app, then somehow selecting Paste with the cursor keys, as they only way of doing that from the keyboard.

  6. rptb1 Says:

    Early Macs didn’t have a Control key.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: