TweetFollow Us on Twitter

Mac in the Shell: Leopard Terminal.app: Create Your Workspace

Volume Number: 23 (2007)
Issue Number: 11
Column Tag: Mac in the Shell

Leopard Terminal.app: Create Your Workspace

Have all the comforts of ~

by Edward Marczak

Introduction

Of all the new features that Leopard brings, one might not think that there could be excitement about Terminal.app. One would be wrong. Along with many others, Terminal.app is my primary interface to the system. Yes, I use applications like Word and Mail.app, of course, but the bulk of the time, I'm looking at a green blinking cursor on a semi-transparent black background. I know I don't have to extol the virtues of shell-mastery any more - you've read that enough in this column. However, OS X 10.5, "Leopard," updates Terminal.app in some nice ways. Let's look at the changes, and then ways to customize your workspace so you're making your environment work for you, not against you.

In the Beginning was the Command Line

Perhaps the easiest thing to point out is that Terminal.app has a new icon. It's amazing how jazzed we can all get over an application's icon, but that's just part of the Mac way, I suppose.


Figure 1 - New Terminal.app icon

It works nicely with the other interface changes in Leopard: a little flatter, but much more stylized.

If you've performed a clean install - which, by the way, I'm a huge advocate of for major releases - and you're not using previous preference files, launch Terminal.app from the Utilities folder and you'll see a default terminal.


Figure 2 - a console window in its default state.

Well, OK...a little bland, perhaps. Nor will 80x25 cut it in most cases. So, let's start with the easy stuff. Stretch that window out and position it on-screen where it best suits you. I like virtual pagers, like Spaces and VirtueDesktops, so, I highly recommend that Terminal gets its own screen. You may also want multiple terminals open at once, and I'll touch on that a bit more later, but suffice it to say, I basically never have less than 9 VTs open at once on my local machine.

Also easy: if you're familiar with Terminal.app already, you won't be lost. Some of the prefs take a minute to absorb, and some items have simply been renamed (gone is "Connect to Server..." replaced with "New Remote Connection...").

A cry for sanity in our silent night of madness

One Mac In The Shell column that has generated a good deal of feedback had screen as its topic. One of Terminal.app's new features happens to be tabs, and most people would think that would do away with screen. Not a chance.

If you're in love with tabs, you probably have been using iTerm or Terminator to satiate your needs. Basically, tabbed terminals have existed for OS X, so, this is catch up for Terminal.app. It's a nice addition nonetheless.

Now, I was the first one that thought I'd just ignore tabs in Terminal.app. I already use screen, right? Turns out, I find them both useful. (If you need a refresher on screen, check out my original article which now appears on-line at http://www.mactech.com/articles/mactech/Vol.21/21.09/Screen/index.html).

Creating a new tab is as simple as Apple-t, which gives you a new tab in the current window with the default scheme. Or, mouse about to the Shell menu, choose "New Tab", and choose the scheme you'd like. Thankfully, we can change tabs with the same key commands available for tabs in Safari - Apple-Shift-} and Apple-Shift-{. (This goes for tabs in iChat, now, too). So, if your muscle memory is built up like mine, this is a nice addition.

Once any window - tabbed or not - is created, pull up the window inspector using Apple-I, or Shell->Show Inspector to change the properties of an existing window (more detail on Inspector later). See Figure 3 for a look at the Inspector itself, with its settings tab open.

I have screen give me 7 VTs at terminal start, and now, one terminal window gives me a two tabs. Why stick with screen? First, screen is less resource hungry than Terminal.app's tabs. Allocating a new bash shell under screen just pops up my memory usage by 800k or so. Each Terminal.app tab takes up about 1.5MB. Why the heck am I concerned about this in the age of multi-Gigabyte machines? Well, perhaps, that's just what I do. Plus, despite the 4GB of RAM that my machine has, it still gets strained while running other apps, virtualization and yes, Warcraft (I can quit anytime. Really). So, that memory counts!

Also, when shelling into a remote machine, I typically still have screen at my disposal, and can just fire up a remote screen session. It seems a bit wasteful to open up many local tabs and ssh each one of those to the same remote host. Finally, screen is just wired into my fingers, so, I stick with it for that and its other nice tricks (and I get to take my .screenrc file to my new home directory and have everything work as expected - what could be better?).


Figure 3 - Terminal tabs and the Inspector window floating over.

the color of television, tuned to a dead channel

Everyone has their own idea of what a perfect terminal screen should look like. Me? I like the 'classic' look of green (or even amber) on black. That's just the way it was. But I also have a 'classic' Commodore 64 looking terminal (blue on blue). While this may seem trivial at first, you're going to be staring at these screens a lot. Also, you're going to need to pick out text from the rest of the clutter on screen. So, find a color scheme that you like and a font that suits you. This has been made easier with the current incarnation of Terminal.app.


Figure 4 - Preferences and Color Picker

While slightly confusing at first, the new preferences really are simplified. Gone are the separate "Preferences" and "Window Settings" menu choices. Now, all 'preferences' are consolidated. Colors, fonts, window sizes and more can be found under the "Settings" group. You can easily define groups of styles that you like and save them for future use, and even export the settings for your or other's use.

One exceptionally nice touch is that if you have a saved terminal definition from, oh, you know, the Tiger days, just double-click it. Not only will you be looking at your familiar terminal, but Terminal.app 2 will import the setting, making it easily called up in the future. To this I say, thankyouverymuch!

Additionally, if you like to have multiple terminal windows open at the same time, the new Window Groups feature is a blessing. All you have to do is get your terminals arranged as you like them: color, fonts, size and position. Then, that can be saved as a Window Group. Simply use the "Save as Window Group..." menu item from the Window menu, or, add it with the "+" button in the Window Group section in Preferences.


Figure 5 - Saved Window Groups

Finally, you can choose a Window Group to appear when you launch Terminal.app. What a fantastic feature!

As far as all of the other Terminal.app accoutrements that you've gotten accustomed to, they're all still there. For anyone in love with Transparency, take note where the opacity slider has moved to. Interestingly, this lets you set opacity on any color element, including text and your highlight color. In other words, you can either end up with something very cool looking, or something that impossible to read!

It is by will alone I set my mind in motion

What else has changed? There is one topic I haven't covered before in this column that I've had some people ask me about recently. Back in the day, when we would be talking about physical terminals, the host system had to know the terminal's capabilities. The terminal that you were using possibly had a real, hardware limit on how many columns it could display, if it supported color or blinking text, graphic support, etc. Ultimately, each terminal's capabilities got catalogued and placed into the termcap database. Fast forward to a contemporary setup, and termcap has become terminfo. Same idea, different name. Figure 6 shows where in Preferences->Settings we declare which terminal type we're emulating (what we're pretending to be).


Figure 6 - Declaring our terminal type

Interestingly, if we're running screen - I use it as my shell - we get a terminal type of screen. There also happens to be a terminfo entry for screen, declaring the capabilities your terminal will have.

Ever notice how after looking at a man page, or say, after using vi, you get the contents of your terminal back. Just like you had never run man or vi? Other programs will do this for you, too. Some physical terminals had an alternate screen buffer that apps are directed to, and when they quit, the main buffer is swapped back in. The xterm-color terminal in OS X mimics that. So, you're poking around the filesystem using cd and ls nad find a text file that you need to edit. Your terminal window is littered with browsing history and the prompt is at the bottom of the window. You fire up vi, edit the file, save and quit. Lo and behold, you're back where you were before editing. The scrollback buffer shows no evidence of the vi session.

screen, coincidentally, has its own scrollback buffer that overrides terminal's. So, as items scroll past the top of the window, they seem gone. Using screen's scrollback (ctrl-[ by default), you can go back through terminal output. Personally, I like my two-finger scroll, despite the mish-mash you get in the process. Apparently, many others do, to, as the first question I get from people that I turn-on to screen is, "why can't I use the scroll bar anymore?"

This is an easy one with a nice fix - "nice" meaning that you can alter the behavior for you, not touch the system defaults, and furthermore carry the change around with you in your home directory. screen lets you override the terminfo entry for a given terminal. Simply place the following line in your .screenrc file:

termcapinfo xterm* ti@:te@

Bail out of screen if it's already running and fire it up again. Use top. Go ahead. Now quit top. All of that output stays plastered all over your terminal. Beautiful, beautiful output! That line simply tells any xterm running under screen that it no longer has the capability of an alternate buffer. It basically redefines the escape codes. If more of this type of skullduggery intrigues you, start with the term(5) man page.

There's a frood who really knows where his towel is

Terminal 2 really brings some nice touches and conveniences to those of us who use a command shell as their primary interface to the system. Even if you don't use it as often as others, getting deep into the system as a developer or sysadmin means breaking out Terminal.app on more than a passing occasion. By this point, you should have a productive and attractive (to you) workspace that works with you.

Media of the month: I should probably be recommending something Leopardish. I can't just yet. But, I was in a book store (again) just the other day and realized how long it had been since I sat down and read fiction. Made up characters, made up places and made up tales. You need to be in touch with reality, but exercising creativity also ranks pretty high. If you've never ready anything by William Gibson, that's my recommendation. Find one that you like. If you've never read anything by Neil Gaiman, please, hurry to your local bookshop and pick up "American Gods" or "Neverwhere." And if you've never put eyes to paper that contains "The Hitchhiker's Guide To the Galaxy," then, run! Go now!

We're also getting close to Macworld. So close that if you haven't made your plans yet, you may be too late. Fire up your web browser, purchase tickets, your travel and hotel for this worthwhile event. Hope to see you there!


Ed Marczak is just this guy, you know? Find out why at http://www.radiotope.com

 

Community Search:
MacTech Search:

Software Updates via MacUpdate

Latest Forum Discussions

See All

Top Mobile Game Discounts
Every day, we pick out a curated list of the best mobile discounts on the App Store and post them here. This list won't be comprehensive, but it every game on it is recommended. Feel free to check out the coverage we did on them in the links... | Read more »
Price of Glory unleashes its 1.4 Alpha u...
As much as we all probably dislike Maths as a subject, we do have to hand it to geometry for giving us the good old Hexgrid, home of some of the best strategy games. One such example, Price of Glory, has dropped its 1.4 Alpha update, stocked full... | Read more »
The SLC 2025 kicks off this month to cro...
Ever since the Solo Leveling: Arise Championship 2025 was announced, I have been looking forward to it. The promotional clip they released a month or two back showed crowds going absolutely nuts for the previous competitions, so imagine the... | Read more »
Dive into some early Magicpunk fun as Cr...
Excellent news for fans of steampunk and magic; the Precursor Test for Magicpunk MMORPG Crystal of Atlan opens today. This rather fancy way of saying beta test will remain open until March 5th and is available for PC - boo - and Android devices -... | Read more »
Prepare to get your mind melted as Evang...
If you are a fan of sci-fi shooters and incredibly weird, mind-bending anime series, then you are in for a treat, as Goddess of Victory: Nikke is gearing up for its second collaboration with Evangelion. We were also treated to an upcoming... | Read more »
Square Enix gives with one hand and slap...
We have something of a mixed bag coming over from Square Enix HQ today. Two of their mobile games are revelling in life with new events keeping them alive, whilst another has been thrown onto the ever-growing discard pile Square is building. I... | Read more »
Let the world burn as you have some fest...
It is time to leave the world burning once again as you take a much-needed break from that whole “hero” lark and enjoy some celebrations in Genshin Impact. Version 5.4, Moonlight Amidst Dreams, will see you in Inazuma to attend the Mikawa Flower... | Read more »
Full Moon Over the Abyssal Sea lands on...
Aether Gazer has announced its latest major update, and it is one of the loveliest event names I have ever heard. Full Moon Over the Abyssal Sea is an amazing name, and it comes loaded with two side stories, a new S-grade Modifier, and some fancy... | Read more »
Open your own eatery for all the forest...
Very important question; when you read the title Zoo Restaurant, do you also immediately think of running a restaurant in which you cook Zoo animals as the course? I will just assume yes. Anyway, come June 23rd we will all be able to start up our... | Read more »
Crystal of Atlan opens registration for...
Nuverse was prominently featured in the last month for all the wrong reasons with the USA TikTok debacle, but now it is putting all that behind it and preparing for the Crystal of Atlan beta test. Taking place between February 18th and March 5th,... | Read more »

Price Scanner via MacPrices.net

AT&T is offering a 65% discount on the ne...
AT&T is offering the new iPhone 16e for up to 65% off their monthly finance fee with 36-months of service. No trade-in is required. Discount is applied via monthly bill credits over the 36 month... Read more
Use this code to get a free iPhone 13 at Visi...
For a limited time, use code SWEETDEAL to get a free 128GB iPhone 13 Visible, Verizon’s low-cost wireless cell service, Visible. Deal is valid when you purchase the Visible+ annual plan. Free... Read more
M4 Mac minis on sale for $50-$80 off MSRP at...
B&H Photo has M4 Mac minis in stock and on sale right now for $50 to $80 off Apple’s MSRP, each including free 1-2 day shipping to most US addresses: – M4 Mac mini (16GB/256GB): $549, $50 off... Read more
Buy an iPhone 16 at Boost Mobile and get one...
Boost Mobile, an MVNO using AT&T and T-Mobile’s networks, is offering one year of free Unlimited service with the purchase of any iPhone 16. Purchase the iPhone at standard MSRP, and then choose... Read more
Get an iPhone 15 for only $299 at Boost Mobil...
Boost Mobile, an MVNO using AT&T and T-Mobile’s networks, is offering the 128GB iPhone 15 for $299.99 including service with their Unlimited Premium plan (50GB of premium data, $60/month), or $20... Read more
Unreal Mobile is offering $100 off any new iP...
Unreal Mobile, an MVNO using AT&T and T-Mobile’s networks, is offering a $100 discount on any new iPhone with service. This includes new iPhone 16 models as well as iPhone 15, 14, 13, and SE... Read more
Apple drops prices on clearance iPhone 14 mod...
With today’s introduction of the new iPhone 16e, Apple has discontinued the iPhone 14, 14 Pro, and SE. In response, Apple has dropped prices on unlocked, Certified Refurbished, iPhone 14 models to a... Read more
B&H has 16-inch M4 Max MacBook Pros on sa...
B&H Photo is offering a $360-$410 discount on new 16-inch MacBook Pros with M4 Max CPUs right now. B&H offers free 1-2 day shipping to most US addresses: – 16″ M4 Max MacBook Pro (36GB/1TB/... Read more
Amazon is offering a $100 discount on the M4...
Amazon has the M4 Pro Mac mini discounted $100 off MSRP right now. Shipping is free. Their price is the lowest currently available for this popular mini: – Mac mini M4 Pro (24GB/512GB): $1299, $100... Read more
B&H continues to offer $150-$220 discount...
B&H Photo has 14-inch M4 MacBook Pros on sale for $150-$220 off MSRP. B&H offers free 1-2 day shipping to most US addresses: – 14″ M4 MacBook Pro (16GB/512GB): $1449, $150 off MSRP – 14″ M4... Read more

Jobs Board

All contents are Copyright 1984-2011 by Xplain Corporation. All rights reserved. Theme designed by Icreon.