Forget droplets, use Dterm!

Posted by matt
on Thursday, January 17

A few days ago, on one of my regular del.icio.us/popular procrastination research trawls, I discovered DTerm, a HUD style, context-sensitive, drop down command line thingemy. It’s pretty cool, with useful features like ‘insert selected items’, and ‘copy results’ and after a couple of updates I can see it being totally great.

Here’s a quick screenshot: Dterm

I’d recommend taking at look at their site for a more complete screencast with some useful ideas.

If you’ve previously used droplets for things like launching TextMate, this might be perfect for you, since instead of having to click, you can just bash the hotkeys, and type mate letter.tex or whatever. You could also dispense with the open terminal here droplet all-together. I’m thinking of trying to hack the glob select droplet (above) to work from the command line as well, but I’m not sure how easy that will be.

Here are a couple of other ideas I’ve had:

  • du -shx ⇧⌘V – to view the size of the currently selected items (works in finder/textmate/etc.).
  • open . – to view the current directory in finder.
  • ⌘↩ – on it’s own to fire up a Terminal in the current working directory.
  • Basically, most things you’d normally switch to the terminal for, you can do with DTerm.

Since I use zsh instead of bash, I found (after talking with Decimus’ support) that I need to launch Dterm using:

env SHELL=/bin/bash open /Applications/DTerm.app 

Otherwise it’ll use zsh, which stops tab completion from working properly. Using this method, you could also pass other options, such as TERM, which DTerm doesn’t currently set itself. The command I’m using at the moment is:

env SHELL=/bin/bash TERM=dterm open /Applications/DTerm.app 

Give it a try!

Making 'home' and 'end' behave in Leopard's Terminal.app

Posted by matt
on Tuesday, November 20

I don’t remember ever having the home or end keys working the way I like them in Terminal.app, but I was recently playing with the new settings interface, and I found the keyboard section. The default, ‘basic’ profile looks like this:

Terminal Settings

Where the ‘Action’ column is the key-code, or action that gets emitted when a given key is pressed. The default for the ‘end’ key is:

Terminal Settings - End

That quite simply means move to the end of the window (or as far down as possible). The ‘home’ key’s default is the opposite of this. Pretty useless, right?

I’ve used zsh for a while now (I’ll put my newest configs on the web in a while), and so I’m used to a good amount of control, and power, and I’m also used to my home and end keys doing what I expect. On other systems I’ve used zkbd, which maps key-codes to actions, but until recently my home and end keys didn’t emit codes. That’s because they just zoom to the start or end of the buffer.

Here’s how I fixed it, and made home and end work again:

First, make yourself a profile, and flip into the keyboard segment of the settings. Choose ‘end’, and press ‘edit’, you’ll get something which looks like this:

Terminal action settings

You need to choose send string to shell, and make the text entry look like mine. To do that, type Control + [, which ought to give you the \033, and follow it by another [, a 4 and a tilde ~. That should be the end key sorted. Now, you need to do the same for the ‘home’ key, only instead of the 4, use a 1.

Now, provided you have your shell set up correctly, it should work!