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

Whitethorn Games combines two completely...
If you have ever gone fishing then you know that it is a lesson in patience, sitting around waiting for a bite that may never come. Well, that's because you have been doing it wrong, since as Whitehorn Games now demonstrates in new release Skate... | Read more »
Call of Duty Warzone is a Waiting Simula...
It's always fun when a splashy multiplayer game comes to mobile because they are few and far between, so I was excited to see the notification about Call of Duty: Warzone Mobile (finally) launching last week and wanted to try it out. As someone who... | Read more »
Albion Online introduces some massive ne...
Sandbox Interactive has announced an upcoming update to its flagship MMORPG Albion Online, containing massive updates to its existing guild Vs guild systems. Someone clearly rewatched the Helms Deep battle in Lord of the Rings and spent the next... | Read more »
Chucklefish announces launch date of the...
Chucklefish, the indie London-based team we probably all know from developing Terraria or their stint publishing Stardew Valley, has revealed the mobile release date for roguelike deck-builder Wildfrost. Developed by Gaziter and Deadpan Games, the... | Read more »
Netmarble opens pre-registration for act...
It has been close to three years since Netmarble announced they would be adapting the smash series Solo Leveling into a video game, and at last, they have announced the opening of pre-orders for Solo Leveling: Arise. [Read more] | Read more »
PUBG Mobile celebrates sixth anniversary...
For the past six years, PUBG Mobile has been one of the most popular shooters you can play in the palm of your hand, and Krafton is celebrating this milestone and many years of ups by teaming up with hit music man JVKE to create a special song for... | Read more »
ASTRA: Knights of Veda refuse to pump th...
In perhaps the most recent example of being incredibly eager, ASTRA: Knights of Veda has dropped its second collaboration with South Korean boyband Seventeen, named so as it consists of exactly thirteen members and a video collaboration with Lee... | Read more »
Collect all your cats and caterpillars a...
If you are growing tired of trying to build a town with your phone by using it as a tiny, ineffectual shover then fear no longer, as Independent Arts Software has announced the upcoming release of Construction Simulator 4, from the critically... | Read more »
Backbone complete its lineup of 2nd Gene...
With all the ports of big AAA games that have been coming to mobile, it is becoming more convenient than ever to own a good controller, and to help with this Backbone has announced the completion of their 2nd generation product lineup with their... | Read more »
Zenless Zone Zero opens entries for its...
miHoYo, aka HoYoverse, has become such a big name in mobile gaming that it's hard to believe that arguably their flagship title, Genshin Impact, is only three and a half years old. Now, they continue the road to the next title in their world, with... | Read more »

Price Scanner via MacPrices.net

B&H has Apple’s 13-inch M2 MacBook Airs o...
B&H Photo has 13″ MacBook Airs with M2 CPUs and 256GB of storage in stock and on sale for up to $150 off Apple’s new MSRP, starting at only $849. Free 1-2 day delivery is available to most US... Read more
M2 Mac minis on sale for $100-$200 off MSRP,...
B&H Photo has Apple’s M2-powered Mac minis back in stock and on sale today for $100-$200 off MSRP. Free 1-2 day shipping is available for most US addresses: – Mac mini M2/256GB SSD: $499, save $... Read more
Mac Studios with M2 Max and M2 Ultra CPUs on...
B&H Photo has standard-configuration Mac Studios with Apple’s M2 Max & Ultra CPUs in stock today and on Easter sale for $200 off MSRP. Their prices are the lowest available for these models... Read more
Deal Alert! B&H Photo has Apple’s 14-inch...
B&H Photo has new Gray and Black 14″ M3, M3 Pro, and M3 Max MacBook Pros on sale for $200-$300 off MSRP, starting at only $1399. B&H offers free 1-2 day delivery to most US addresses: – 14″ 8... Read more
Department Of Justice Sets Sights On Apple In...
NEWS – The ball has finally dropped on the big Apple. The ball (metaphorically speaking) — an antitrust lawsuit filed in the U.S. on March 21 by the Department of Justice (DOJ) — came down following... Read more
New 13-inch M3 MacBook Air on sale for $999,...
Amazon has Apple’s new 13″ M3 MacBook Air on sale for $100 off MSRP for the first time, now just $999 shipped. Shipping is free: – 13″ MacBook Air (8GB RAM/256GB SSD/Space Gray): $999 $100 off MSRP... Read more
Amazon has Apple’s 9th-generation WiFi iPads...
Amazon has Apple’s 9th generation 10.2″ WiFi iPads on sale for $80-$100 off MSRP, starting only $249. Their prices are the lowest available for new iPads anywhere: – 10″ 64GB WiFi iPad (Space Gray or... Read more
Discounted 14-inch M3 MacBook Pros with 16GB...
Apple retailer Expercom has 14″ MacBook Pros with M3 CPUs and 16GB of standard memory discounted by up to $120 off Apple’s MSRP: – 14″ M3 MacBook Pro (16GB RAM/256GB SSD): $1691.06 $108 off MSRP – 14... Read more
Clearance 15-inch M2 MacBook Airs on sale for...
B&H Photo has Apple’s 15″ MacBook Airs with M2 CPUs (8GB RAM/256GB SSD) in stock today and on clearance sale for $999 in all four colors. Free 1-2 delivery is available to most US addresses.... Read more
Clearance 13-inch M1 MacBook Airs drop to onl...
B&H has Apple’s base 13″ M1 MacBook Air (Space Gray, Silver, & Gold) in stock and on clearance sale today for $300 off MSRP, only $699. Free 1-2 day shipping is available to most addresses in... Read more

Jobs Board

Medical Assistant - Surgical Oncology- *Apple...
Medical Assistant - Surgical Oncology- Apple Hill Location: WellSpan Medical Group, York, PA Schedule: Full Time Sign-On Bonus Eligible Remote/Hybrid Regular Apply Read more
Omnichannel Associate - *Apple* Blossom Mal...
Omnichannel Associate - Apple Blossom Mall Location:Winchester, VA, United States (https://jobs.jcp.com/jobs/location/191170/winchester-va-united-states) - Apple 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
Operations Associate - *Apple* Blossom Mall...
Operations Associate - Apple Blossom Mall Location:Winchester, VA, United States (https://jobs.jcp.com/jobs/location/191170/winchester-va-united-states) - Apple Read more
Business Analyst | *Apple* Pay - Banco Popu...
Business Analyst | Apple PayApply now " Apply now + Apply Now + Start applying with LinkedIn Start + Please wait Date:Mar 19, 2024 Location: San Juan-Cupey, PR Read more
All contents are Copyright 1984-2011 by Xplain Corporation. All rights reserved. Theme designed by Icreon.