Skip to main content

GNU screen: A Graphical Replacement

GNU screen is an essential application, yet its learning curve is insanely steep. Even everyday users barely scratch the surface of what it can do due to lack of knowledge. Neither the defaults (e.g. no caption by default) nor the interface (e.g. tons of special key combinations that hopefully don't conflict with your existing applications) make things any easier. I've been thinking a lot about how to improve it.

Imagine what you could do if you were to use a GUI for some cool new version of screen. Now I know that there's a real benefit to the way screen works in that all you need on the client side is a terminal, and I'm sure many a GUI hater will think I'm missing the point of screen. Let's face it though, I do have a graphical desktop. Furthermore, I'm not talking about getting multiple terminals on the local system. Tabbed terminals solve that trivially. I'm talking about multiple terminals running on a remote system that may or may not be prone to sudden HUPs. Ideally, the GUI client could make things a lot more user friendly. Here's how you use screen:
(multiple ptys) <-> screen <-> ssh <-> your terminal
You type commands into your terminal, and screen does something with them. Sometimes the commands influence screen itself. Other times, screen passes them onto the active pty. Now, imagine an improved graphical version of screen. For the time being, I'll call it scrim, SCReen IMproved:
(multiple ptys) <-> scrim server <-> ssh <-> scrim client <-> (multiple GUI terminals, such as gnome-terminal)
Note that you now have 4 windows on the client, the scrim client and the 3 terminal applications. Perhaps you might use a terminal that supports tabs to consolidate the 3 terminals. Since the scrim client has its own window, it can be really easy to use, and there are no keybinding conflicts. The terminal applications each act like separate terminal sessions. A lot of multiplexing is going on between the scrim server and scrim client. There's a "tunnel" for each terminal, and a "tunnel" for the server and client to talk about configuration. Nonetheless, you can still close the scrim client and reconnect later without loosing anything. I'm not really proposing anything new except to say that an interface that's more like Remote Desktop could make using screen a lot more pleasant and reduce the learning curve.

Now, if I only had the time and intelligence to code it :) It makes me wonder how hard it would be to do something like this, writing the client and server in Python. Naturally, the server must be very standard, and there may be multiple clients for say, KDE, GNOME, OS X, etc. Specifically out of scope is dealing with any terminal code myself. Terminals are not for the faint of heart, and I think it's possible to just connect the two pty's and let terminal software do the hard work.

If you know of such an existing application, please tell me.


jjinux said…
For maximum portability to servers you may not have much control over, it makes sense to have a version of the scrim server written in C. Perhaps it can even be a statically built binary. The client can be written in whatever language makes sense for GUI development. Perhaps a Python client and server can be built as reference implementations. At some level in the protocol, JSON can be used to transport rich data in a language independent manner. Perhaps the lower level protocol is based around length:data in order to support the multiple streams needed. However, the particular stream devoted to transmitting configuration data could use JSON. One thing to remember is that no matter what you do, we're not talking about TCP, we're talking about a pty connection, for instance SSH.
Warren said…
You're not the only one to have the exact same idea. I found your blog by searching for "gui gnu screen replacement" on google.

No luck so far, but stay tuned. I realize that it's at least 64000 times too much data to do it this way, but I like VNC for this purpose: You remotely connect even to a graphical desktop and then open up terminals in it. Then, when your internet connection hiccups, your bit-torrent downloads, or whatever, are not interrupted.

Anonymous said…
I'll be the proverbial GUI hater here and just say you're missing the point. :)

Seriously, screen within screen. Just ssh to the remote server and start screen. This is what I do; I just have different command keystrokes for the remote server (typically the standard C-a for local, and C-t for remote). It works out pretty easy. And I don't lose the advantages that screen gives me: low bandwidth, remotely usable, detachable, etc. etc.

My only real complaint with screen is that every few weeks or months it crashes due to some weird terminal redraw. If it were more stable, or it ran windows in subprocesses, that would be ideal for me. (In fact, I already do this for a couple of windows using dtach.)
jjinux said…
Here's how it would work. There's something on the remote server that's running. Right that, that's screen. However, in my world, it's something lower level. Locally, you can run a GUI. A GUI with menus is very easy to use, however, it has all the same power as screen because it's controlling the remote process. Furthermore, all the bandwidth considerations are the same.
jjinux said…
I just stumbled across this today:

"tmux is a terminal multiplexer: it enables a number of terminals (or windows), each running a separate program, to be created, accessed, and controlled from a single screen. tmux may be detached from a screen and continue running in the background, then later reattached."

The screen shots are pretty:
jjinux said…
I looked a tmux a bit. I'd say it's worth using on a remote system, but less so for your desktop. Terminals are a pain, and even tmux can't fix all their problems ;)
Anonymous said…
tmux is very much worth using on your local machine. Ever have a program you want to run in the background and not see until you want it? Get sick of having 10+ terminals open? I run a program called pianobar (to play pandora music without flash...) in tmux, detach it and get to listen to music without having an extra terminal cluttering my desktop.
jjinux said…
Hmm, I use tabs for that, although I'm sure tmux is lovely.

Popular posts from this blog

Drawing Sierpinski's Triangle in Minecraft Using Python

In his keynote at PyCon, Eben Upton, the Executive Director of the Rasberry Pi Foundation, mentioned that not only has Minecraft been ported to the Rasberry Pi, but you can even control it with Python. Since four of my kids are avid Minecraft fans, I figured this might be a good time to teach them to program using Python. So I started yesterday with the goal of programming something cool for Minecraft and then showing it off at the San Francisco Python Meetup in the evening.

The first problem that I faced was that I didn't have a Rasberry Pi. You can't hack Minecraft by just installing the Minecraft client. Speaking of which, I didn't have the Minecraft client installed either ;) My kids always play it on their Nexus 7s. I found an open source Minecraft server called Bukkit that "provides the means to extend the popular Minecraft multiplayer server." Then I found a plugin called RaspberryJuice that implements a subset of the Minecraft Pi modding API for Bukkit s…

Apple: iPad and Emacs

Someone asked my boss's buddy Art Medlar if he was going to buy an iPad. He said, "I figure as soon as it runs Emacs, that will be the sign to buy." I think he was just trying to be funny, but his statement is actually fairly profound.

It's well known that submitting iPhone and iPad applications for sale on Apple's store is a huge pain--even if they're free and open source. Apple is acting as a gatekeeper for what is and isn't allowed on your device. I heard that Apple would never allow a scripting language to be installed on your iPad because it would allow end users to run code that they hadn't verified. (I don't have a reference for this, but if you do, please post it below.) Emacs is mostly written in Emacs Lisp. Per Apple's policy, I don't think it'll ever be possible to run Emacs on the iPad.

Emacs was written by Richard Stallman, and it practically defines the Free Software movement (in a manner of speaking at least). Stal…

JavaScript: Porting from react-css-modules to babel-plugin-react-css-modules (with Less)

I recently found a bug in react-css-modules that prevented me from upgrading react-mobx which prevented us from upgrading to React 16. Then, I found out that react-css-modules is "no longer actively maintained". Hence, whether I wanted to or not, I was kind of forced into moving from react-css-modules to babel-plugin-react-css-modules. Doing the port is mostly straightforward. Once I switched libraries, the rest of the port was basically:
Get ESLint to pass now that react-css-modules is no longer available.Get babel-plugin-react-css-modules working with Less.Get my Karma tests to at least build.Get the Karma tests to pass.Test things thoroughly.Fight off merge conflicts from the rest of engineering every 10 minutes ;) There were a few things that resulted in difficult code changes. That's what the rest of this blog post is about. I don't think you can fix all of these things ahead of time. Just read through them and keep them in mind as you follow the approach above.…