Ubuntu brings advanced Screen features to the masses

The latest version of Ubuntu includes some nifty embellishments to the GNU …

GNU Screen is a powerful terminal multiplexer that makes it easy for users to manage multiple sessions at the command line. It provides rudimentary window management capabilities in text-based environments and enables users to detach a session and resume it later. The tool has long held a position of distinction among the most popular terminal utilities for system administrators.

Although Screen is very powerful, it is also difficult to configure. Most users aren't even aware of its more advanced features and few take advantage of its full potential. In an effort to make Screen more accessible to the masses, the Ubuntu developers have assembled a nice collection of embellishments that make the program easier to configure and use. These improvements are delivered in the screen-profiles package, which was introduced in Ubuntu 9.04.

Ubuntu's screen-profiles will display status and task management bars at the bottom of the window. These are intended to serve roughly the same purpose as the GNOME panel. When the user creates additional screen "windows," these will be displayed in the task list and the active window will be displayed with highlighting.

The status bar at the bottom shows colored bits of text that describe the system's current status. Some of these include the current processor load, the amount of memory used, the number of users logged into the system, the current uptime, the version of Ubuntu, battery status, WiFi signal strength, and the current network load. When used in an EC2 instance, there is even one that will show you the current cost of your session. The user can configure which ones are displayed by using a text-based menu system.

Ubuntu's screen-profiles also offer a simpler set of default keyboard shortcuts for screen management that are intended to be easier to use and less likely to conflict with other programs and the user's graphical terminal program. These are mostly based around the function keys at the top of the keyboard. The most commonly used keys are displayed in a simple help panel.

The screen-profiles features were demonstrated by Dustin Kirkland on Monday during an Ubuntu Open Week session that took place in the #ubuntu-classroom channel on the FreeNode IRC server. During the session, Kirkland invited participants to ssh into an Amazon EC2 instance with a shared screen session which he used to illustrate various screen-profiles capabilities. He believes that Ubuntu's screen improvements will boost the usability of the command line in Ubuntu server environments.

"I'm hoping for Karmic that screen-profiles is used ubiquitously on the server [and] that it becomes as important to the Ubuntu server as Gnome/KDE are to Ubuntu/Kubuntu," he said during the presentation.

The feature is already available by default in Ubuntu 9.04. The screen profile chooser will be displayed automatically the first time that the user launches screen. On previous versions of Ubuntu, you can get screen-profiles by installing the package from a PPA. For more details, refer to the relevant page from the Ubuntu Server documentation.

I have to say this is another Ubuntu-ism I hate with a passion. I have my own screenrc which gets overridden by this screen-profiles crap. So I have yet another package to purge. I don't need the equivalent of conky in every one of my screen sessions.

It's getting to the point where I'm going to have to learn puppet, just so that I can have a new machine purge all of the garbage Ubuntu puts on the system I want to have nothing to do with.

Originally posted by jus10:I have to say this is another Ubuntu-ism I hate with a passion. I have my own screenrc which gets overridden by this screen-profiles crap. So I have yet another package to purge. I don't need the equivalent of conky in every one of my screen sessions.

It doesn't overwrite your .screenrc at all. If you run screen normally, you never encounter it.

I've been quite happy with the new features of screen in Ubuntu but there is one feature I'm going to have to figure out how to disable:

if I ssh into my home machine, screen automatically opens up. I have rtorrent running in screen all the time, so if I ever tunnel home, the first thing I see is rtorrent, not the terminal. It's not a big deal, but I don't like it.

Originally posted by ads2:It doesn't overwrite your .screenrc at all. If you run screen normally, you never encounter it.

That's not been my experience. If screen-profiles is installed, screen utilizes settings in ~/.screen-profiles, not ~/.screenrc.

It doesn't matter; I do think learning puppet is in order because this package is just one of many that gets thrown out the door when I do an install.

quote:

Sounds like you need to move on to Debian.

Indeed, for a server that's the logical choice for a .deb based distro. My server is FreeBSD based though. Ubuntu is a decent desktop. It just annoys me the level of tweakage needed to get it my way. I guess I should just look into automating it.

Invariably I always seemed to be locked in a cycle of Ubuntu until the moronic decisions of its maintainers force me to Debian, and then Debian until I'm tired of fighting to make it work. Wash and repeat.

Originally posted by cyrus:I've been quite happy with the new features of screen in Ubuntu but there is one feature I'm going to have to figure out how to disable:

if I ssh into my home machine, screen automatically opens up. I have rtorrent running in screen all the time, so if I ever tunnel home, the first thing I see is rtorrent, not the terminal. It's not a big deal, but I don't like it.

Top screenshot in the article shows you the "F9" menu, the bottom option there is install/remove screen on startup

quote:

Originally posted by jus10:Invariably I always seemed to be locked in a cycle of Ubuntu until the moronic decisions of its maintainers force me to Debian, and then Debian until I'm tired of fighting to make it work. Wash and repeat.

Then find another distribution, maybe slackware?

I like Ubuntu's usability improvements and I find most their defaults to be sane.

Originally posted by jus10:Invariably I always seemed to be locked in a cycle of Ubuntu until the moronic decisions of its maintainers force me to Debian, and then Debian until I'm tired of fighting to make it work. Wash and repeat.

Then find another distribution, maybe slackware?

I like Ubuntu's usability improvements and I find most their defaults to be sane.

No, that's not what I meant (although I have run slackware as well). My perfect distro is somewhere in between Ubuntu and Debian. Neither on is perfect; both are very nice. I just want X from Ubuntu and Y from Debian.

It's neat to see innovation here. Configuration is the speedbump that keeps otherwise terminal-friendly users from using it.

Innovation?!

Screen power users have been using .screenrc since before Ubuntu existed!

Yes... that's exactly what I meant. I've been using it for over a decade myself. My point was that many non-screen users know that screen exists but never dive in, since the default configuration is impenetrable unless you have someone actively explaining what is going on. The innovation IS the easy configuration system.

rm ~/.screenrc, run screen, and see how much sense it makes. The only effect is that C-a C-k no longer clears your input line!

But what I really want to know is ... When running screen, how do I get control-a to go to the beginning of a line (without remapping keys)? An escape character would be great, especially if I could target a particular screen (I sometimes run screen inside of screen; sometimes even inside of another screen).

You know what I would love from Screen? Mouse/GUI integration. If I'm running Screen in xterm (or for that matter, any other graphical terminal emulator) or (possibly) on the console with gpm, if I click on a split region, I'd like to have it switch its focus to that part of the split. Also, if I use the scroll wheel buttons, I'd like for screen to honor the scrollback; as charming as the Ctrl-[ copy/scrollback mechanism is, I would like to enjoy those few GUI "enhancements" I actually use. (Some kind of libscreen could make this process easy for such emulators.) I mean, Vim can do these.

(And speaking of Screen and Vim, I've had a really weird problem with running Vim in Screen over SSH freezing the entire Screen session, and I can't explain it. I typically need to log into the machine separately and terminate Screen in order to free up the first login session.)

If that happens, such that I can then detatch and reattach, and also have my shell sessions survive an X crash (sigh... NVIDIA...), that would be very nice, and it would better allow windowing systems and the command line to work together. Maybe when I have the time in a couple of weeks, I'll look into it more thoroughly than I already have.

Originally posted by jennyw:But what I really want to know is ... When running screen, how do I get control-a to go to the beginning of a line (without remapping keys)? An escape character would be great, especially if I could target a particular screen (I sometimes run screen inside of screen; sometimes even inside of another screen).

I am surprised nobody has yet asked if the new features were backported/submitted to the GNU maintainers, so that other distros can make use of it. Ubuntu has often come under fire for not contributing back to the community.

Originally posted by jus10:I have to say this is another Ubuntu-ism I hate with a passion. I have my own screenrc which gets overridden by this screen-profiles crap. So I have yet another package to purge. I don't need the equivalent of conky in every one of my screen sessions.

It's getting to the point where I'm going to have to learn puppet, just so that I can have a new machine purge all of the garbage Ubuntu puts on the system I want to have nothing to do with.

The screen profiles helper works by adding the launcher to your ~/.profile and any shell-specific rc files you have. Additionally, it adds its own screen configuration files to ~/.screen-profiles, under which is the 'profile' file, which screen-launcher will source. That file will source ~/.screenrc as the last action it does, so it can not override your .screenrc.

Originally posted by jus10:I have to say this is another Ubuntu-ism I hate with a passion. I have my own screenrc which gets overridden by this screen-profiles crap. So I have yet another package to purge.

I'm sorry, but this is plainly inaccurate.

If screen-profiles detects that you already have an ~/.screenrc file in place, it assumes that you've already tweaked screen to your liking.

Originally posted by chem:I am surprised nobody has yet asked if the new features were backported/submitted to the GNU maintainers, so that other distros can make use of it. Ubuntu has often come under fire for not contributing back to the community.

I have been in touch with the upstream screen maintainers, and have sent them a couple of fixes and enhancements that allow these profiles to work better.

Debian has packaged screen for their distribution, and I have been touch with others from Red Hat, SuSE, Gentoo, and Arch about packaging. These are underway, as I understand it.

Furthermore, I created the screen-profiles-export command, which generates a tarball that you can expand in your home directory on basically any system that has screen installed.

To date, I have created screen-profiles "logos" for the status bar for each of the following distributions: * ubuntu, arch, centos, debian, fedora, foresight, gentoo, mandriva, redhat, slackware, suse, xandros

Much love for screen. I used it 24/7 in my college sysadmin days. So fscking useful yet such a pain to remember all the intricate key/function mappings. And recursive screens... A dangerous cocktail of screen, emacs, and lisp left me with a perverse fondness for recursion, complicated key/function mappings, and matched parenthesis. What you can accomplish is limited only by the size of your working memory.

Originally posted by jus10:I have to say this is another Ubuntu-ism I hate with a passion. I have my own screenrc which gets overridden by this screen-profiles crap. So I have yet another package to purge. I don't need the equivalent of conky in every one of my screen sessions.

It's getting to the point where I'm going to have to learn puppet, just so that I can have a new machine purge all of the garbage Ubuntu puts on the system I want to have nothing to do with.

It's neat to see innovation here. Configuration is the speedbump that keeps otherwise terminal-friendly users from using it.

Innovation?!

Screen power users have been using .screenrc since before Ubuntu existed!

Yes... that's exactly what I meant. I've been using it for over a decade myself. My point was that many non-screen users know that screen exists but never dive in, since the default configuration is impenetrable unless you have someone actively explaining what is going on. The innovation IS the easy configuration system.

This is what kept me from using screen. I went with dtach instead, nice & simple. But these enhancements to screen look interesting, maybe I'll check them out..

Amazing. I use screen all the time on OS X, and I'm still finding the optimum configuration. I hope more than anything else, that this brings attention to screen from the CLI-curious GUI-lovers, because I'd like to see a number of features added to screen itself, rather than just have it be easily configurable. For me, configurability isn't the difficulty, it's that I'd like screen *itself* to work well, for example, with side-by-side splitscreens, I'd like a non-hacky way to get the current tty name along side the process running in the hardstatus bar, and like others mentioned, mouse support would be stellar.

When I enter "screen" then "top" at the terminal I get a nicely laid out set of information about my machine's resources.

But when I enter "screen-profiles" then select "New Window", then set up "top" in the "Command" field, I get a mess. The system info (Memory Used, Swap Used etc.) which appears along the top of my ordinary "top" command is AWOL. The individual processes don't look correct either; they certainly don't match what's in the "ordinary" version, and I know which one I trust! I've tried reducing the font size in the console window settings, but no difference.

Originally posted by bersl2:(And speaking of Screen and Vim, I've had a really weird problem with running Vim in Screen over SSH freezing the entire Screen session, and I can't explain it. I typically need to log into the machine separately and terminate Screen in order to free up the first login session.)

You might be accidentally hitting Ctrl-S, which sends an XOFF character and freezes screen. When this happens you can recover by pressing Ctrl-Q for XON.