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.

  • Digg
  • Facebook
  • Twitter
  • Fark
  • Delicious
  • Slashdot
  • Squidoo
  • Blinklist
  • Backflip
  • Diigo
  • Propeller
  • Mixx
  • MySpace
  • Reddit
  • StumbleUpon
  • Tagza
  • Technorati Favorites
  • Share/Bookmark

Comments

6 Comments on "I’m Afraid It’s Terminal"

  1. Gregg on Thu, 19th Mar 2009 6:16 am 

    Fantastic post Dave!

    MacOS integrates so well with the terminal because it’s – FreeBSD
    Of course it’s going to kill Microshaft because it’s a unix-derivative with a GUI. I just think it’d be great if I could hit Alt + F[1-6] and get some dos terminals like I can in Linux. That’d be hella (un)useful. :)

    I really enjoyed this one. Thanks.

    Gregg

  2. *NUX Terminal Junkies. | ThisCoolSite on Thu, 19th Mar 2009 6:57 am 

    [...] Check it out here. [...]

  3. Quint on Thu, 19th Mar 2009 11:35 am 

    Yes, I really have only 2 gripes with the Mac Terminal:
    1) This could be the legacy cmdline apps, but a lot of times the terminal will not wrap the output of commands. I would at least like the option for this. (Hate to give MS cmd anything, but they do this well)

    2) As I have discussed with DAve before, the annoying key combo for switching tabs

    I also really got used to the MS cmd copy paste, select, left click to copy, right click to paste. For me it is a very very fast way to do copy paste in terminal. If my hand is already on the mouse to select, why not have the two buttons right under your fingers do something useful? Seriously, do I really need a context window in terminal? I always found this to be the best feature in the Windows cmd app.

  4. David Smith on Thu, 19th Mar 2009 11:51 am 

    Oh, yeah, the wrapping thing. I’m also not sure if that’s legacy UNIX or what, but I’ve run into that, too – especially the ‘ps’ command. Took me a whole day to figure out why my process wasn’t showing up when I did a ‘ps | grep ‘ – it was because it was getting cut off. Bastards.

    And like I said, the DOS window is very highly optimized in and of itself. But in the context of an overall windowing system, why should I have to learn more than one copy/paste shortcut?

    And yes, Mac’s Terminal app fails on the whole tab-switching thing. Not sure why they f’d up that shortcut.

  5. Quint on Thu, 19th Mar 2009 9:24 pm 

    Agreed, I think the key combos for copy paste in the cmd should be the same. What screws it all up for every OS except Mac is the older yer Ctrl-C to kill programs. For Mac that is still true…but blah blah blah, you already covered that and nailed it square. I can’t say I argue with any of your points at all, my list was just additions that would make it even better :)

    I honestly hated bash with a passion (prefer tcsh) until I switched to Mac. Mac has just done so many things right with the terminal app that it appears the issues I had with bash were not really bash, but the ugly terminal apps I was using.

    Good write up!

  6. Ian on Mon, 20th Jul 2009 7:43 pm 

    Hmm… Terminal.app is usable, to be sure, and pretty, but way too quirky for me. When I press PgUp, I want that key to go to my pager, or to my editor, or to `screen`, not to the terminal’s scroll bar. That’s what Shift-PgUp is for.

    I can’t live with anything besides gnome-terminal. The tabs open with Ctrl-Shift-t, and switch with Ctrl-PgUp/PgDn. And of course on any non-Mac OS, you can bring one terminal window to the front, without bringing *all* of them to the front. Aaaargh! Keeping application windows layered together is not a good idea for general purpose things like terminals and web browsers. And copy-and-paste is really easy on *nix: select text, middle click where you want it. Not that Mac software will ever implement that behavior outside of X11, let alone deal with middle clicks… You can also use Ctrl-Shift-[CV] in gnome-terminal.

    Quint: Terminal always wraps the output of commands. The command you are using probably detects the terminal width and chops long lines. Pipe the command to `less -S` to fix this.

    –Ian

Tell us what you're thinking...
and oh, if you want a pic to show with your comment, go get a gravatar!