I’m Afraid It’s Terminal

Being a developer, I’ve used lots of terminal programs on lots of operating systems over the years, starting with BASIC on my TI-99/4A and Commodore 128* (BASIC 7.0!), various Sun machines in college, CDE/Motif on various platforms, on through DOS, MKS Toolkit, Linux (Gnome & KDE) and of course Mac OS X.

All programmers have their favorite term emulator that they’ve grown accustomed to and know how to tweak, and every time they move to a new system they find some way to re-create that environment. But most of them are wrong.

The best terminal program in the world, I have to say, is Mac OS X’s Terminal.app. It’s the only term program I’ve ever encountered that just works. I’m not really talking about the features of the shell, here – Bash is Bash, and DOS is DOS. What I’m talking about is how the Terminal behaves as an application in the OS.

Copy Cat

Exhibit A: Cut and Paste. All you UNIX hackers, I can hear you groaning. Every UNIX terminal program since the dawn of the epoch has had a different keyboard shortcut for these. Why? Because “Ctrl-C” is used to stop execution of a UNIX process, but “Ctrl” is also the main modifier key for things like Cut, Copy and Paste in UNIX windowing systems. Oops.

So now you have to remember that when you’re pasting to or from the terminal program on whatever flavor of UNIX, that it’s Shift-Insert or Ctrl-Shift-V or some other crap.

Oh, and let’s not forget about Windows. What’s “Copy” on a DOS window? The Return key? Really? You couldn’t think of anything else? And on some others it’s right-click to paste, if you can even get that to work (sometimes by choosing “Mark” from some hidden popup menu, just to enable copy/paste). Yeah, that’s useful.

I use Windows at work and one of the things I have to do while deploying a release is copy three commands from a PuTTY window into an MKS Toolkit Bash window and execute them. I know, it’s a horrifically manual process and should be fixed, but that’s not the point right now.

This is the process I go through for each command:

  1. Select the text in PuTTY with the mouse.
  2. Switch to the Bash window, right click on the title bar, go to Edit submenu, click Paste
  3. Hit enter.

There isn’t even a keyboard shortcut that I can find for pasting into MKS Bash windows. Oh, and I didn’t miss a step there: you don’t need to “copy” from the PuTTY window. For some reason, it just assumes anything you select should go in the clipboard. While it does save you one step, it’s so unexpected that it creates extra cognitive load.

On the Mac, it’s Cmd-X/C/V, just like every other app.

Back in Black

Another classic UNIX sore spot is the backspace. Due to historical reasons that I don’t have enough neck-beard to get into, the backspace code was never quite settled in UNIX, so that depending on what system or what terminal emulator you were using, when you hit backspace/delete, you got a ^H or some other control code appearing on the line, and you had to try to remember what the damn backspace key was on that system. It went on for so long that it became a black eye^H^H^H^H^H^H^H^H^Hrunning joke on USENET.

On Terminal.app, Backspace deletes to the left, and Delete deletes to the right. If there are no characters in the indicated direction, a simple beep lets you know.

Paging Dr. Ritchie

Why, oh why, would you do anything except page the window up or down when the user hits the Page Up or Page Down keys? What sense does anything else make? It’s the 21st century people. I realize that many of these UNIX conventions were thought up in 1963 by Dennis Ritchie, but I think it’s time to do away with them.

In a DOS window, I’m not even sure what Page Up/Down do. They seem to go back some number (not “1″) of commands, but I can’t be bothered to spend any more time figuring out how many, or why you would want to do that.

X Windows seems to just puke on Page Up/Down (like most keys that were not on an original teletype, UNIX has never quite decided what to do with them). X11 on Mac OS just beeps and spits out a tilde. Terminal on Ubuntu does the same, except it only spits out the tilde on Page Down, not Up. Nice and consistent.

(A sidenote on the Home and End keys. In Mac OS, they scroll to the top or bottom of a document. Apparently, on other systems, they take you to the beginning or end of a line of text, and some people are used to that. By itself, it’s debatable which is better. But since Home and End sit right next to Page up and Page Down, I think having them be the “more extreme” versions of Page Up and Page down (if you will) makes more sense than having a completely unrelated function. It’s all in keeping with the idea that the windowing system is integral to the OS.)

Stretch Marks

Did Microsoft just give up after DOS 3.3? Have they not realized that you can fit more than 80 characters on a screen now? It’s like they just stopped developing the DOS window program in the early Nineties. You can’t stretch a DOS window any wider than what it is at launch, and given that you tend to start out in “C:\Documents and Settings\username” you tend to not have much space to type anything else without wrapping.

And it’s not like you can’t resize the window – you can make it narrower. For all those six-character-wide directory listings. Come on, now. They have to know that people are still using the DOS window. Especially their precious “Developers! Developers! Developers!” (Yes, you can widen the DOS window by going to the preferences, but you shouldn’t have to.)

Ubunto and Mac get full marks for stretchability on this one, even going so far as to reflow existing text to the new width.

Master of the Obvious

Most of these issues would have been annoying but understandable in the wild west days of competing UNIXes (UNIXen? UNIII?). These systems were developed and optimized for the world of the command line. If you have no mouse or other windows to worry about, some of these conventions start to make sense. But we’ve had windowing systems for 25 years now. Do you really have to maintain compatibility with a 1963-era mainframe? Or if you do, does it have to be in the system’s default terminal app?

And the Linux crowd wonders why they don’t have desktop acceptance.