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

Ubuntu 20.04 on a 2015 15" MacBook Pro

I decided to give Ubuntu 20.04 a try on my 2015 15" MacBook Pro. I didn't actually install it; I just live booted from a USB thumb drive which was enough to try out everything I wanted. In summary, it's not perfect, and issues with my camera would prevent me from switching, but given the right hardware, I think it's a really viable option. The first thing I wanted to try was what would happen if I plugged in a non-HiDPI screen given that my laptop has a HiDPI screen. Without sub-pixel scaling, whatever scale rate I picked for one screen would apply to the other. However, once I turned on sub-pixel scaling, I was able to pick different scale rates for the internal and external displays. That looked ok. I tried plugging in and unplugging multiple times, and it didn't crash. I doubt it'd work with my Thunderbolt display at work, but it worked fine for my HDMI displays at home. I even plugged it into my TV, and it stuck to the 100% scaling I picked for the othe

ERNOS: Erlang Networked Operating System

I've been reading Dreaming in Code lately, and I really like it. If you're not a dreamer, you may safely skip the rest of this post ;) In Chapter 10, "Engineers and Artists", Alan Kay, John Backus, and Jaron Lanier really got me thinking. I've also been thinking a lot about Minix 3 , Erlang , and the original Lisp machine . The ideas are beginning to synthesize into something cohesive--more than just the sum of their parts. Now, I'm sure that many of these ideas have already been envisioned within , LLVM , Microsoft's Singularity project, or in some other place that I haven't managed to discover or fully read, but I'm going to blog them anyway. Rather than wax philosophical, let me just dump out some ideas: Start with Minix 3. It's a new microkernel, and it's meant for real use, unlike the original Minix. "This new OS is extremely small, with the part that runs in kernel mode under 4000 lines of executable code.&quo

Haskell or Erlang?

I've coded in both Erlang and Haskell. Erlang is practical, efficient, and useful. It's got a wonderful niche in the distributed world, and it has some real success stories such as CouchDB and Haskell is elegant and beautiful. It's been successful in various programming language competitions. I have some experience in both, but I'm thinking it's time to really commit to learning one of them on a professional level. They both have good books out now, and it's probably time I read one of those books cover to cover. My question is which? Back in 2000, Perl had established a real niche for systems administration, CGI, and text processing. The syntax wasn't exactly beautiful (unless you're into that sort of thing), but it was popular and mature. Python hadn't really become popular, nor did it really have a strong niche (at least as far as I could see). I went with Python because of its elegance, but since then, I've coded both p