Re: Great SWT Program
On 2007-11-24 08:05:43 -0800, nebulous99@gmail.com said:
On Nov 21, 7:51 pm, Owen Jacobson <angrybald...@gmail.com> wrote:
Eh? Nesting screen instances?
Running screen from within a screen instance causes a new session to
be added to the existing screen instance, not a new screen instance to
be created.
That would be a violation of POSIX standards, the same way that "new
Foobar()" returning a reference to a pre-existing Foobar would violate
the JLS.
You could, of course, have tried it for yourself and discovered that it
does do exactly as described. Here's the mechanism:
A new instance of the program "screen" does run, but before it gets
around to creating any of the screen UI it examines the environment.
If it finds a reference to an existing screen instance containing the
name of a writable unix socket, the newly-started screen program sends
commands on the socket destined for the existing screen program. Then
it exits, instead of continuing on, leaving the running screen instance
to open a new screen and run the passed command.
I understand the same pattern is relatively common on Windows apps that
want to restrain all interactions to a single instance of the program,
as well. In the case of screen, this is a desireable behaviour
specifically because manipulating nested screen instances, while
possible, is unpleasant.
Fortunately, you can pass the keystroke the attention sequence
replaced on to the current screen just fine: with the default
attention sequence (C-a), the keystroke C-a a sends C-a to the active
screen.
Wouldn't C-a C-a be less awkward and more obvious? As it stands, it
sounds like if you let go of the control key too late Bad Things will
happen.
As it happens, C-a C-a does something even *more* useful by default,
which I am much happier with than passing a C-a to the active screen.
I'll leave it to you to look in the documentation and find out what,
but here's a hint: if you accidentally hit C-a C-a when you meant to
hit C-a a, you get immediate feedback about what happened and you can
go back with a second C-a C-a.