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

Tokkun Studio unveils alpha trailer for...
We are back on the MMORPG news train, and this time it comes from the sort of international developers Tokkun Studio. They are based in France and Japan, so it counts. Anyway, semantics aside, they have released an alpha trailer for the upcoming... | Read more »
Win a host of exclusive in-game Honor of...
To celebrate its latest Jujutsu Kaisen crossover event, Honor of Kings is offering a bounty of login and achievement rewards kicking off the holiday season early. [Read more] | Read more »
Miraibo GO comes out swinging hard as it...
Having just launched what feels like yesterday, Dreamcube Studio is wasting no time adding events to their open-world survival Miraibo GO. Abyssal Souls arrives relatively in time for the spooky season and brings with it horrifying new partners to... | Read more »
Ditch the heavy binders and high price t...
As fun as the real-world equivalent and the very old Game Boy version are, the Pokemon Trading Card games have historically been received poorly on mobile. It is a very strange and confusing trend, but one that The Pokemon Company is determined to... | Read more »
Peace amongst mobile gamers is now shatt...
Some of the crazy folk tales from gaming have undoubtedly come from the EVE universe. Stories of spying, betrayal, and epic battles have entered history, and now the franchise expands as CCP Games launches EVE Galaxy Conquest, a free-to-play 4x... | Read more »
Lord of Nazarick, the turn-based RPG bas...
Crunchyroll and A PLUS JAPAN have just confirmed that Lord of Nazarick, their turn-based RPG based on the popular OVERLORD anime, is now available for iOS and Android. Starting today at 2PM CET, fans can download the game from Google Play and the... | Read more »
Digital Extremes' recent Devstream...
If you are anything like me you are impatiently waiting for Warframe: 1999 whilst simultaneously cursing the fact Excalibur Prime is permanently Vault locked. To keep us fed during our wait, Digital Extremes hosted a Double Devstream to dish out a... | Read more »
The Frozen Canvas adds a splash of colou...
It is time to grab your gloves and layer up, as Torchlight: Infinite is diving into the frozen tundra in its sixth season. The Frozen Canvas is a colourful new update that brings a stylish flair to the Netherrealm and puts creativity in the... | Read more »
Back When AOL WAS the Internet – The Tou...
In Episode 606 of The TouchArcade Show we kick things off talking about my plans for this weekend, which has resulted in this week’s show being a bit shorter than normal. We also go over some more updates on our Patreon situation, which has been... | Read more »
Creative Assembly's latest mobile p...
The Total War series has been slowly trickling onto mobile, which is a fantastic thing because most, if not all, of them are incredibly great fun. Creative Assembly's latest to get the Feral Interactive treatment into portable form is Total War:... | Read more »

Price Scanner via MacPrices.net

Early Black Friday Deal: Apple’s newly upgrad...
Amazon has Apple 13″ MacBook Airs with M2 CPUs and 16GB of RAM on early Black Friday sale for $200 off MSRP, only $799. Their prices are the lowest currently available for these newly upgraded 13″ M2... Read more
13-inch 8GB M2 MacBook Airs for $749, $250 of...
Best Buy has Apple 13″ MacBook Airs with M2 CPUs and 8GB of RAM in stock and on sale on their online store for $250 off MSRP. Prices start at $749. Their prices are the lowest currently available for... Read more
Amazon is offering an early Black Friday $100...
Amazon is offering early Black Friday discounts on Apple’s new 2024 WiFi iPad minis ranging up to $100 off MSRP, each with free shipping. These are the lowest prices available for new minis anywhere... Read more
Price Drop! Clearance 14-inch M3 MacBook Pros...
Best Buy is offering a $500 discount on clearance 14″ M3 MacBook Pros on their online store this week with prices available starting at only $1099. Prices valid for online orders only, in-store... Read more
Apple AirPods Pro with USB-C on early Black F...
A couple of Apple retailers are offering $70 (28%) discounts on Apple’s AirPods Pro with USB-C (and hearing aid capabilities) this weekend. These are early AirPods Black Friday discounts if you’re... Read more
Price drop! 13-inch M3 MacBook Airs now avail...
With yesterday’s across-the-board MacBook Air upgrade to 16GB of RAM standard, Apple has dropped prices on clearance 13″ 8GB M3 MacBook Airs, Certified Refurbished, to a new low starting at only $829... Read more
Price drop! Apple 15-inch M3 MacBook Airs now...
With yesterday’s release of 15-inch M3 MacBook Airs with 16GB of RAM standard, Apple has dropped prices on clearance Certified Refurbished 15″ 8GB M3 MacBook Airs to a new low starting at only $999.... Read more
Apple has clearance 15-inch M2 MacBook Airs a...
Apple has clearance, Certified Refurbished, 15″ M2 MacBook Airs now available starting at $929 and ranging up to $410 off original MSRP. These are the cheapest 15″ MacBook Airs for sale today at... Read more
Apple drops prices on 13-inch M2 MacBook Airs...
Apple has dropped prices on 13″ M2 MacBook Airs to a new low of only $749 in their Certified Refurbished store. These are the cheapest M2-powered MacBooks for sale at Apple. Apple’s one-year warranty... Read more
Clearance 13-inch M1 MacBook Airs available a...
Apple has clearance 13″ M1 MacBook Airs, Certified Refurbished, now available for $679 for 8-Core CPU/7-Core GPU/256GB models. Apple’s one-year warranty is included, shipping is free, and each... Read more

Jobs Board

Seasonal Cashier - *Apple* Blossom Mall - J...
Seasonal Cashier - Apple Blossom Mall Location:Winchester, VA, United States (https://jobs.jcp.com/jobs/location/191170/winchester-va-united-states) - Apple Read more
Seasonal Fine Jewelry Commission Associate -...
…Fine Jewelry Commission Associate - Apple Blossom Mall Location:Winchester, VA, United States (https://jobs.jcp.com/jobs/location/191170/winchester-va-united-states) Read more
Seasonal Operations Associate - *Apple* Blo...
Seasonal Operations Associate - Apple Blossom Mall Location:Winchester, VA, United States (https://jobs.jcp.com/jobs/location/191170/winchester-va-united-states) - Read more
Hair Stylist - *Apple* Blossom Mall - JCPen...
Hair Stylist - Apple Blossom Mall Location:Winchester, VA, United States (https://jobs.jcp.com/jobs/location/191170/winchester-va-united-states) - Apple Blossom Read more
Cashier - *Apple* Blossom Mall - JCPenney (...
Cashier - Apple Blossom Mall Location:Winchester, VA, United States (https://jobs.jcp.com/jobs/location/191170/winchester-va-united-states) - Apple Blossom Mall Read more
All contents are Copyright 1984-2011 by Xplain Corporation. All rights reserved. Theme designed by Icreon.