Get Delete to Work All the Time:
To get delete to work in utilities like sftp, ftp, etc, run the following command locally (That isn't a literal ^H, you type that character by doing 'ctrl-v' and then 'ctrl-h'):
echo stty erase ^H >> ~/.profile
And now you can source ~/.profile, and you should be set.
Get PgUp, PgDn, and Alt to work:
Bring up the dialog to configure the terminal by right-clicking (or ctrl-click) the terminal window, and click on 'Window Settings'. Most of the things here a fairly obvious, so I'll leave it up to you to play around with them. What we are concerned about is under the "Keyboard" section:
- Turn on "Delete key sends backspace"
- Enable "Use option key as meta key". This will enable things like "alt+b" to go back a word, and "alt+f" to go forward a word.
- look for the key-binding for 'page up' and edit it. Change the action to 'send string to shell', and in the text box, hit escape (it will show up as \033), and type "[5~". Do the same for 'page down', but type "[6~" instead. This will enable page up and page down to work inside of a pager or an editor.
I don't like to use X11 on Mac OS, but sometimes I have to. When I do, I'd rather launch it in the background, and start applications from Terminal.
Put the following in ~/.profile:
export DISPLAY=:0.0
now make a .xinitrc file:
echo "exec quartz-wm" >> ~/.xinitrc
Now when you launch X11, it will only start a window manager, and not xterm.
Launching Mac Apps from Terminal:
You can launch a Mac application by running "open -a AppName". In ~/.profile, I like to add a few aliases:
alias hexedit="open -a 0xED"
alias edit="open -a TextMate"
Now you can edit a file with 0xED by running "hexedit filename". You can do this for almost every Mac app. If you have a file with an extension (like .doc, or .torrent), you can just ask Mac OS to use the appropriate App by running "open filename".
Scanning for Wireless Networks from Terminal:
If you find yourself missing iwconfig in linux, or the wireless extensions of BSD's ifconfig, then you will probably like this. The normal wireless applet is good enough for me most of the time, but it doesn't tell you if networks are encrypted or not, you can get this information in a terminal.
There should be an executable at:
"/System/Library/PrivateFrameworks/
Apple80211.framework/Versions/A/Resources/airport"
You can alias this to "airport" in ~/.profile if you like. You can list the available options by running it with "-h". My favorite option is "-s", which lists all of the APs and information about what kind of network they are running on.
Thats it for now. All but the first two sections should work in iTerm as well. I personally think that iTerm over-complicates a relatively simple thing, so I'd rather use a tweaked Terminal.
No comments:
Post a Comment