PDA

View Full Version : Tell me about Screen


Elledan
06-25-2004, 05:11 AM
I recently found out about the existence of Screen (http://www.gnu.org/software/screen/), a "full-screen window manager that multiplexes a physical terminal between several processes, typically interactive shells".

Reading the responses to posts regarding Screen on Slashdot, it seems that this is a very useful program for a GUI-less system.

What I would like to know is how it works (I would almost mention screenshots =) ), how it is used (by you or others) and some general opinions on this application.

deuce868
06-25-2004, 06:53 AM
man screen...and I quote:

When screen is called, it creates a single window with a shell in it
(or the specified command) and then gets out of your way so that you
can use the program as you normally would. Then, at any time, you can
create new (full-screen) windows with other programs in them (including
more shells), kill existing windows, view a list of windows, turn out-
put logging on and off, copy-and-paste text between windows, view the
scrollback history, switch between windows in whatever manner you wish,
etc. All windows run their programs completely independent of each
other. Programs continue to run when their window is currently not vis-
ible and even when the whole screen session is detached from the user's
terminal. When a program terminates, screen (per default) kills the
window that contained it. If this window was in the foreground, the
display switches to the previous window; if none are left, screen
exits.

Everything you type is sent to the program running in the current win-
dow. The only exception to this is the one keystroke that is used to
initiate a command to the window manager. By default, each command
begins with a control-a (abbreviated C-a from now on), and is followed
by one other keystroke. The command character and all the key bindings
can be fully customized to be anything you like, though they are always
two characters in length.

ameoba
06-25-2004, 01:21 PM
screen's pretty cool; I used it Back In The Day when my only connection to the internet was a dialup shell (pre-Solaris SunOS). There's also some interested features it has that let you disconnect a session & come back later.

If you're working without a GUI, I guess it'd still be usefull, but, in most cases, you're probably better served my just having multiple terminals (or a tabbed terminal).

Elledan
06-26-2004, 04:41 AM
screen's pretty cool; I used it Back In The Day when my only connection to the internet was a dialup shell (pre-Solaris SunOS). There's also some interested features it has that let you disconnect a session & come back later.

If you're working without a GUI, I guess it'd still be usefull, but, in most cases, you're probably better served my just having multiple terminals (or a tabbed terminal).
Well, the idea is to use Screen on a headless system which will be used for testing apps I'm developing. A GUI would just be a waste of resources, but the one thing I never liked about CLIs is that they pretty much suck for multi-tasking. It appears that Screen would solve that problem.

[H]EMI_426
06-26-2004, 05:57 AM
I run my IRC clients in screen at home on one of my FreeBSD boxes, then ssh to that FreeBSD box from work and just reattach the screen session.

I run game servers on my FreeBSD boxes under screen all the time.

screen is great for things you don't want or can't have on a terminal all the time, but would like to keep running.

It's not all that handy for stuff that requires a GUI, but it works wonders for things that don't need a GUI...Since most of my FreeBSD boxes are headless I use screen quite a bit.

I really like the ability to attach to the same session from multiple places.

As far as how it works, the man page is pretty clear.

ameoba
06-26-2004, 02:45 PM
If you're running it on a headless box, how are you connecting to it?

Elledan
06-26-2004, 03:42 PM
If you're running it on a headless box, how are you connecting to it?
SSH.

[H]EMI_426
06-26-2004, 10:53 PM
If you're running it on a headless box, how are you connecting to it?How do you connect to your headless boxes? SSH, of course...

ameoba
06-27-2004, 02:19 PM
if it's SSH, you're probably better off having multiple windows on the host machine.


if you're going to complain about having to log in, look into keys & agents.

deuce868
06-27-2004, 02:30 PM
the nice thing about screen is you can log out with ssh and come back later and connect to the same screen.

[H]EMI_426
06-27-2004, 02:40 PM
if it's SSH, you're probably better off having multiple windows on the host machine.


if you're going to complain about having to log in, look into keys & agents.It has nothing to do with multiple windows or logging it. It's simply a way to keep things running without backgrounding them.

ssh <machine>
log in

screen
irssi

Then I can go to work, ssh to the same machine, then just type "screen -x [PID, if there's more than one screen session]" and be reconnected with my irssi client while it's still displaying at home as well.

The FreeBSD ports tree...I can screen and disconnect from a build on a machine at home that I started at work...If there's a chance there may need to be user input, like when a dependancy is built and it asks questions, I can just reconnect to the screen session, answer the questions and disconnect the session again.

It has nothing to do with ssh, logging in, multiple windows, etc. It's all about handling what the displayed output/input does, where it goes and how it's displayed.

It really is a handy tool.