Home

May 2008

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

An even better OpenSSH interface

As I've mentioned before, in my spare time I've been working on a fun project to replace the Unix terminal and shell with native graphics and a high-level language runtime. One thing that I quickly found out though was that certain applications require a real VT100 terminal emulator; for example, less is a highly optimized program, and while replacing it with a proper X11 app would be possible, it would not be trivial and would largely be a distraction from my goals anyways. Another situation where you need a terminal emulator is connecting to remote Unix hosts; while I have complete control over the software on my laptop, it's hard to change all the existing servers out there.


SSH in particular is something that really cries out for a nice application around it, rather than launching it primitively from an existing terminal emulator. Earlier I mentioned the result of a few hours of PyGTK hacking. Over the last week or two I've been working on improving it. Today David Ascher of Thunderbird fame asked for it, so I should probably kick it out the door (though HotSSH is primarily for X11/Unix and not the Mac).



New connection with history


As you can see, the new version of HotSSH now remembers what you do, automatically. For example:

  • If you connect to a host and use a custom username, the next time you open HotSSH and type the host again, it defaults to that custom username, without you having to do anything

  • It has pretty good completion on the Host entry, based both on ~/.ssh/known_hosts as well as its own history

  • Open windows and tabs are saved automatically, Firefox style


The only dependencies are CPython, GTK+, DBus, and OpenSSH. I've broken it out of where it previously lived in the Hotwire tarball into a separate source tarball. You can currently get it from the Hotwire downloads page, though my long term plan is to import it into GNOME SVN and ideally have it come with GNOME out of the box. The code is currently here, and bug reports here. It works well enough for me now; about all it might make sense to add is some sort of color scheme (we currently just pull from the gnome-terminal defaults). To run, you can just unpack the tar and python ui/hotwire-ssh. If you install it, it should create a default bash alias for ssh, but this is something that package distributors will need to make sure integrates well.

Comments

(Anonymous)

Looks incredible

This looks incredible -- I'm looking forward to the Windows port being usable!

Re: Looks incredible

Heh, not going to happen anytime soon. HotSSH has a hard dependency on OpenSSH which is Unix only.

I thought about pulling in something like Paramiko and being more portable, but it's really hard to get all the integration details right.

I suppose I could pull in Cygwin...man that would be fun =)

Re: Looks incredible

This seems a lot like Putty
http://www.chiark.greenend.org.uk/~sgtatham/putty/
which incidentally has recently(-ish) become available for linux too. The more the merrier.

There is potential here and it is a smart idea to hold onto useful Secure Shell information and using a graphical user interface to make things just that little bit easier.

I would encourage also to avoid the acronyms if at all possible when naming your application, consider that "Secure Shell" is a short clear and more understandable phrase than an acronym would be to anyone not already familiar with SSH.

Wow.

The lazyweb rocks.

Have you considered an OS X port? ;-)

(Anonymous)

replacing less with a proper X11 application

Havoc beat you to it (http://svn-archive.gnome.org/viewvc/gnome-libs/tags/GNOME_LIBS_1_4_1_7_CORRECTED/libgnomeui/gnome-less.h?revision=6618&view=markup)

Re: replacing less with a proper X11 application

Heh, no - and this is exactly what I mean:

{
errno = 0; /* Reset it to detect errors */
while (TRUE) {
s = fgets(buffer, GLESS_BUFSIZE, f);

if ( s == NULL ) break;

gtk_text_insert(gl->text, gl->font, NULL, NULL, buffer, strlen(s));
}

That's going to be slow on a file of a few hundred megabytes. less is a very optimized application. To do it on X11 properly (handling large files) you'd probably need to have the notion of a sliding window instead of just putting it all into a GtkTextView.

(Anonymous)

bah

dude, just add code to gnome-terminal to do that already. there's even a but open about it...

behdad

Re: bah

The code for it would share almost nothing with gnome-terminal except VTE (which it already shares!) and the notebook tabs with close buttons (this really needs to go into GTK+ proper). We use a separate menubar, separate icon, etc.

Meanwhile I'd have to reimplement all the stuff like DBus integration, NetworkManager integration, SQLite history storage+search in C...not fun.

Re: bah

Ok, I did copy the gnome-terminal URL matching rules. But I think it makes sense to put those in VTE.
I doubt you can get much useful info from ~/.ssh/known_hosts these days (other than historical data). All the entries on my system are hashed, which would make completion difficult.

If you are setting up a new system to remember previously contacted hosts, it might be worth looking into the reasons OpenSSH had for making this change.

(Anonymous)

hotwire integration

So do I have to install this separate to hotwire now? Or will there be some svn trickery to integrate it?

Just done an svn update and ssh no longer works from within hotwire. hotapps/hotssh/ is now empty.

(Anonymous)

Hotwire looks interesting but...

I was thinking to give it a shot, but while reading how it is superior over others, one thing hit me: when I type 'rm -rf /' i mean 'rm -rf /' not 'mv /* ~/.Trash'! Even if sometimes I may regret it. Indeed nice thing, but just not for me. :)