A Guided Tour of Hotwire 0.333

May 7, 2007

Hotwire has advanced quite a bit since last I mentioned it. For the most part now, I am using it to develop itself, instead of gnome-terminal. Of course I’ve tried this a few times in the past week, but I wouldrun into some bug that drove me back – until I fixed it. Add a lot of those fixes together though, and it’s starting to actually feel usable.

One feature I added last night that’s kind of a small thing but I am fond of is the last command. What last does is pretty simple – it returns the output of the previous command. This lets you interactively refine pipelines. For example, say you type cat foo.log | grep error. Now, suppose you want to further refine that for strings that match ‘’. In a shell, you’d likely hit the up arrow, then append to the previous command. But doing so is wasteful (and sometimes unsafe) because it re-executes the entire pipeline; if foo.log is big you have to wait for it to be refiltered (or save it to a file, grep that…ug). Using last in Hotwire feels natural (and I plan to shorten the syntax to just ‘|’).

Hotwire executing /sbin/ifconfig

After grepping for inet6

You may notice from the screenshot that a lot more has changed. Here’s a quick sample of stuff visible there:
  • Hotwire now auto-resolves commands you type by prefixing them with sh or term as appropriate. So for example you can just type ifconfig and Hotwire knows you mean sh /usr/sbin/ifconfig.
  • There are now tabs; try pressing Ctrl-t
  • The display looks a lot nicer! I’m mostly done “porting” to GTK+.

So, cool. But there’s more! Realizing that because right now Hotwire requires the output of commands to all be of the same class (e.g. LinuxProcess, unicode), I redid the entire rendering infrastructure using a tree view. A picture is worth a thousand words here:

Hotwire executing its ps command…on Windows!

So the first thing to notice here is that the output of the ps command is nicely formatted into columns based on its object properties (remember, the Hotwire builtin ps command outputs Process objects, not random bits of text).

The second thing to notice is…wait a minute, that’s Windows! Yes. Hotwire boots on Windows now, and I fully intend to make it a mostly-first class citizen. I am still recovering from the mental scars inflicted from trying to learn the Win32 API enough to enumerate processes, but it’s there. It’s a pretty rare developer in the world that doesn’t ever have to use Windows, and frankly I think Hotwire blows cmd.exe out of the water already for when you need to.

Another thing to notice in the above screenshot is the status message about kill – that’s what you see when you use…right click menus!

Right click on a process to get a Kill option

Now, I want to talk about completion. The TAB completion engine is on its third iteration, and it’s starting to feel about 80% of what bash does. If you use Hotwire for a while you will miss common-prefix completion (you’ll know what I mean), and some other details, but it’s mostly good enough, at least for me.

One thing that is a definite improvement though is that Hotwire offers you previous-token completion. Let’s say you type host example.com. Hotwire not only records this in your history (so if you type ping you can hit the up arrow to reuse the command), but also remembers example.com as a token you used previously. If you start to type it again in any context, Hotwire offers it. For example:

Remembering you typed example.com earlier

This is all part of the Hotwire philosophy of remembering everything you type, and making sure you never type the whole thing again.
Speaking of remembering things, Hotwire now also remembers which commands you used sh for and which you used term. For example, if you type term vi /tmp/foo.txt:

From now on you can just type vi and Hotwire will remember to prefix it with term instead of sh.

Last but not least, I battled setuputils and in the end produced a FC6 RPM and a source zip file: Download page.
I’m playing around with Google Apps for hosting the user pages, so excuse the bareness.

That’s it for now, going to post before LiveJournal eats this!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: