8.8 - Tips and Tricks
Working with the Mac, one gets somewhat used to the idea that everything is easy. And I think that's true, as long as you use the machine at the OSX / GUI level and don't get into complex operations that actually require you to change how your machine works, as opposed to how it looks and/or feels.
The following pages consist of a series of tips and tricks that I found difficult to locate information on, and that once I found the information, it still seemed to me to be non-obvious by design, rather than as a consequence of my own ignorance.
8.8.1 - Mac Terminal to RH9
Before we get into this, I am using OSX 10.4.5 right now, so if you're at another revision level, this may work more or less correctly. I know this is a bit of esoterica, but it was so annoying to figure out, I thought I'd throw it up here for the rest of the world to find via search engines and so forth.
The Mac's Terminal application is a bit troublesome if you want to work with other systems. I have to; behind my company's multiple firewalls, there are several Redhat 9 linux systems. I prefer to shell into these, fire up Midnight Commander, and have at whatever needs doing.
Making Terminal behave, though, is a bit of a trial. First, the function keys have been appropriated at a system level by the Mac's Expose feature, and there appears to be no way to get them back on an individual application basis (in other words, only when Terminal is running.) So the workaround for this, unpleasant as it may be, is to go to the system keyboard preferences and turn off the use of those keys. (You may be able to get expose functionality back with the hot corners feature, but I've not tried that as yet.)
Next, pageup, pagedown, home and end have been mapped to scrolling the Terminal window's scrollback buffer. To fix this, right click on Terminal, select Window Settings, Keyboard, remove any of the page up, page down, home and end entries and replace them with the correct codes. For xterm-color using UTF-8, both of which I highly recommend because I've found that they work, use...
- Home: ESC[1~
- End: ESC[4~
- Pageup: ESC[5~
- Pagedn: ESC[6~
...which will make those four keys work. Once you've set these, click on Use As Defaults so that the changes stick, or you'll be re-entering them again later on.
Finally, on the target system, when you log in or in the shell startup script, add this...
- EXPORT LANG=C
...which will allow line drawing characters to work properly.
At this point, at least with Redhat 9, you should have a working terminal interface to your target machines using SSH.
Have a comment for me? Click here.