[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: screen vs. multiple xterm's + remote connection



Will Trillich wrote:

On Mon, Aug 16 at 12:24AM -0700, Paul Scott wrote:

I keep looking at "screen." I just tried it again. My temporary conclusion is that it would be obviously very valuable when not running X. When running X I more often than not want to see two or more consoles (xterms, etc.) at the *same* time.

Clearly I could make all of my xterms into "screen"'s and get the best of both worlds but it's not clear at this point why I would want to bother. Could some of you "screen" users suggest some circumstances under which I would benefit from this? How does "screen" beat multiple xterms?

inside your xterm, launch an editor and make some changes.

now before you save those changes, close your xterm window.
gone!

or, try getting into that session from another computer. not very
bloody likely! (there may be ways, of course, but the easy
solution is much sexier.)

try again:

launch another xterm. inside xterm, start 'screen'.

now launch an editor and edit something. don't save changes
(this happens to all of us, admit it!) and close your xterm.

poof! it's STILL THERE!

you can now switch to console (alt-ctl-f1) and do "screen -D -R"
to reattach to your original session!
My editor was emacs. It remained running in X where without screen emacs was killed. Indeed I could restart the screen session.

really, no, really! make
some more changes, go out for lunch...

now visit a buddy across town and ssh in to your server from his
windows machine and do "screen -D -R" and take up where you left
off. when his computer freezes up, no worries (for you)...

now you travel to piscataway and borrow an imac there to ssh in
to your home machine and do "screen -D -R" and resume your
undo/redo state, command-line history, suspended jobs et al --
as if you hadn't ever left that first xterm.

priceless!
I haven't learned how to do this yet.

a newbie who you've infected with the debian bug calls you in
distress with a shell scripting problem. you can't go over to
see what's up just now (the spouse is nearly home from work and
you've got plans for the evening). the newbis isn't explaining
herself very well, so you just have her run "screen" and then
you ssh in remotely to her machine using her login, and you run
"screen -x". now you can WATCH her keystrokes (and intervene!)
as she demonstrates -- live -- what she's having trouble with.
See above.

in considering xterm and screen, they are NOT mutually exclusive:
i.e it's NOT "multiple xterms" VS. "multiple screens".
I didn't make that comparison.  "screen" was singular above. :)

"screen" rules the roost, around here.

the only limitation is that the MACHINE on which you started your
screen session can't die -- screen uses a pipe/socket/thingie
that it plops into /var/run/screen in order to ply its magic, so
if your server dies, you're out of luck. heck, not only the
socket is wiped out, but so are the processes that had been
running under your screen session. (it'd be nice if screen had
dome sort of save-to-disk-for-later-resume-after-restart
algorithm, but screen handles plenty of miracles already...)
after a while you come to expect a screen session to be able to
withstand anything, but it can't last thru a server restart! :)
I have a DSL router connecting my LAN to the Internet. I would like to learn and test some of the SSH combinations you do routinely. I would need to use PuTTY on a Windows 98 machine on this LAN to try to find this Debian sid machine on the Internet to see if I can do any of this. I have no trouble doing this on the LAN. I will read some HOWTO's but would take any quick suggestions you have for doing this.

Thanks,

Paul




Reply to: