Home

Advertisement

Customize

October 2009

S M T W T F S
    123
45678910
11121314151617
18192021222324
25262728293031
Powered by LiveJournal.com

A Guided Tour of Hotwire 0.333

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 would run 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 '192.168.1.1'. 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!



Comments

(Anonymous)

Cool thing

This is the app that I dream of for some years. I also feel that the common terminals are not of much help and do not really fit into a graphical desktop. I would like to add that the kind of app is also helpful to simple users if you add some functionality. These would like to have the ability to type what they want (like "edit filename") and then the gnome tools (in this case gedit) starts. i think one could use the same tool for different purposes: admin usage and simple user. I also like to suggest that one has some shortcuts from bash like "Ctrl+U" for deleting. Right now this app is mainly nice to play with - I guess it can become a very helpful and standard tool. Keep up the good work!

Thilo

(Anonymous)

Re: Cool thing

btw. in Foresight one can install version 0.333 by doing "sudo conary update hotwire=foresight.rpath.org@fl:1". I just did the package.

(Anonymous)

Hotwires

Nice project!

Hmm... the name seems to already be used for another gnome(-related) project..
Google returns this as one of the top hits for "hotwire gnome":
http://eric.extremeboredom.net/projects/Hotwire/

Always sucky when you have to fight over a name with someone else packaging something different...

//fatal

Re: Hotwires

Ug! I did google around of course before picking the name, but I didn't think to try adding "gnome". The first 5 pages or so on google weren't software so I decided it was good enough.

I dunno...I'm kind of attached to the name =) We'll see.

Re: Hotwires

It does look like that other project never really did a 'release', despite having been ongoing for nearly three years. I wouldn't sweat it too much. Look forward to installing F7 and playing with this in a couple weeks :)

sh?

Hi Colin,

You mentioned adding output to indicate sh or term with an example of "sh /sbin/ifconfig". If you were being literal, I think you meant "sh -c /sbin/ifconfig" since your executing ifconfig in a shell, not having the shell process ifconfig. Just a nitpick.

Good luck with the project.

Re: sh?

Actually I was being literal; "sh /sbin/ifconfig" is a Hotwire command which means "Execute /sbin/ifconfig" using a shell. If you type "sh -c /sbin/ifconfig" it'll try to execute "-c".

Remember, that entry box isn't just something that does fork/exec on /bin/sh. Hotwire implements its own commands and syntax, but allows you to easily go out to the shell for non-native commands.

This might be clearer if you note that "sh ipconfig /all" works on Windows.

(Anonymous)

Awesome idea

That is all :)
Off to try it ...

M.Pomme
Cool! I'm playing with it now. (It was a little tricky to install on Rawhide, though; you require python(abi)==2.4, and the setup.py uses setuputils.)

Could I suggest one feature that I've been hoping someone would add to gnome-terminal for years now -- incremental interactive backwards-search for scrollback?

Thanks!

(Anonymous)

RPM misses dep

I've installed FC6 RPM and I get:

"Traceback (most recent call last):
File "/usr/bin/hotwire", line 5, in ?
from pkg_resources import load_entry_point
ImportError: No module named pkg_resources"

It seems that "yum install python-setuptools" fix this.

Re: RPM misses dep

Yeah, definitely a bug. Long story short, I want to drop setuputils (the current build system) in favor of something better, just need to find that thing and make it go. setuputils was just what I semi-randomly picked as a first pass.
How big is the last command's buffer? How do you indicate to the user if the output is too big to store in memory?
As big as GtkTextView and/or your system's process memory limit can handle =)

Honestly few things most developers do in daily work should be "too big" for typical systems. Possibly 'make' on a very large project could be problematic, but I notice those kinds of projects (e.g. Linux kernel) tend to put some work into reducing gcc's crazy verbosity to make it easier to find stuff.

Also keep in mind, if you want to do something like 'tcpdump' which has infinite output, just 'term tcpdump' and you get a terminal. Hotwire doesn't take away the terminal, it's always available.

I am designing Hotwire keeping in mind developers who use systems with at least 512MB of RAM, preferably 1G or more. My laptop has 2G. If one is tight on space, there's always xterm+bash.
Let me be more precise about what I think the problem is.

There's always the danger that the user will accidentally invoke a command with infinite output, and leave it unattended. It's not a good idea to run out of memory and crash in those circumstances.

True. Worth doing but there's a queue of stuff I need to fix before issues like that...but patches accepted =)
this looks pretty exciting.

Advertisement

Customize