A freelance web developer / software engineer based in the UK

GNU Screen: Split Screen Terminal

GNU Screen is a terminal application for running persistent, multiple sessions inside a single terminal (or in the most useful case, a ssh connection)

Running Screen:

apt-get install screen: installs screen on Debianscreen: starts a new screen sessionscreen -r: reattaches to an existing screen sessionscreen -x: reattaches to an existing screen session where the original session is still attached (happens when screen has not been properly detached)Ctrl-a d: detaches from a running screen session (note this will lose split screen placement – this is the only way I’ve found to avoid that)

Ctrl-a |: Split screen vertically (note this one isn’t in all screen versions – it is in the Debian one however)Ctrl-a S: Split screen horizontallyCtrl-a Tab: Switch to the next screenCtrl-a X: Remove active bit of split screen (opposite from | and S)

Copy and Paste:

Screen supports copy and paste between terminal sessions. Copying from a vertically split screen from an ssh session (as in to a different application on your client operating system) can be tricky if it extends over multiple lines, as you’ll get the stuff from the other terminal too – Perry Nguyen has a solution for this, although I’ve yet to try it.

Posts navigation

3 comments on “GNU Screen: Split Screen Terminal”

Oh, I never knew Ctrl-a Tab switches between windows. I always bound :focus down to a key instead. Haha.Also, did you know that Ctrl-a Space switches to the next terminal session too? Can be quicker than Ctrl-a n as you can do it with one hand 🙂

Hmm never knew that, though only time I ever use it is when I’ve lost the last screen session somehow. Incidentally, have found screen -x will restore when an SSH session has lost the current screen session but not released it for screen -r (happens with Putty and Vista with distressing regularity) – believe it was initially meant for having the same screen session open on multiple computers. Will add both to the article above.

Yeah, screen -x is 'Resume to already attached screen session'. Also, if you run lots of screens; screen -S somename gives the screen a name. You can then use screen -ls to list the current screen sessions (and their status).

Top Posts

Search

About Me

I do freelance programming, web development, bioinformatics, and generally anything computer or molecular-biology based.
I've got bachelor degrees from the University of York, with a BSc in Computer Systems and Software Engineering, and the University of Sheffield, with another BSc in Biochemistry & Molecular Cell Biology. Employment-wise, I've been doing freelance programming for over 10 years now.
Most of the stuff here is for my own reference, but hopefully if you've ended up here you'll find something useful...