Re: Newbie questions

Phil!Gregory <[email protected]> Thu, 25 Mar 2004 17:04:16 -0500
Newsgroups gmane.comp.gnu.screen
Message-ID <[email protected]>
* [email protected] <[email protected]> [2004-03-25 14:33 -0500]:
> 1. It appears that the DISPLAY variable gets messed up when I detach
>    my screen window at work, re-attach it at home, and then
>    detach/re-attach it once more at work.

Sven's page is rather light on details, and the solution doesn't always
work.  Here's the lowdown:

$DISPLAY is an environment variable.  Whenever you run a program, that
program inherits the environment variables from the program that called
it.  On a standard Unix box, the sequence goes something like this:  X
starts, sets $DISPLAY; X launches your window manager (twm, afterstep,
KDE, etc.), which receives $DISPLAY; the window manager starts an xterm,
which gets $DISPLAY; xterm starts your shell (bash, ksh, zsh, etc.), which
gets $DISPLAY; you run screen from the shell, so screen gets that
$DISPLAY; screen starts its own shells, they get the same $DISPLAY.  When
you detach and reattach somewhere else, the value of $DISPLAY within
screen is the same as when it started, so X apps will try to display on
the original X session.  If you use the screen command 'setenv', you will
change the value of $DISPLAY for screen and any new programs that screen
starts, but your running shells will still have the old value.  You must
run 'export DISPLAY=<your $DISPLAY value here>' in those shells to fix
it.  (Use 'setenv DISPLAY <value>' if you're running csh or tcsh.)

> 2. If I don't use screen, running along the very top of my terminal
>    window is the window's title (the host's name), but when I start
>    screen, this window title disappears.

Probably your distribution putting stuff in the system-wide screenrc to do
this.  Quick fix: put

  termcapinfo xterm 'hs@'

in your ~/.screenrc .  If you get spurious messages at the bottom of your
screen session, add

  hardstatus ignore

also.

> 3. In the screen man page, in a table that appears in the section
>    called "THE VIRTUAL TERMINAL", the abbreviations Pn, Pcs, and Ps
>    are used repeatedly, but their meanings are not given anywhere.
>    What do they mean?

Standard abbreviations for terminal escape codes.  In all three cases, the
"P" indicates that it's a parameter--it's something you can change when
using the escape code.

Pn - number
Ps - series of numbers, separated by semicolons
Pcs - From looking at the screen man page, I gather that this is a number
      that represents a character set.  I could be wrong about this.

> P.S. Please Cc: me in your replies.

The standard way to indicate this is to have your mail client put your
email address in a Mail-Followup-To: header.  Not all mail clients support
this; I don't know the category that yours falls into.

-- 
...computer contrarian of the first order... / http://aperiodic.net/phil/
PGP: 026A27F2  print: D200 5BDB FC4B B24A 9248  9F7A 4322 2D22 026A 27F2
--- --
A sine curve goes off to infinity, or at least the end of the blackboard.
                       -- Prof. Steiner
---- --- --


 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
     http://groups.yahoo.com/group/gnu-screen/

<*> To unsubscribe from this group, send an email to:
     [email protected]

<*> Your use of Yahoo! Groups is subject to:
     http://docs.yahoo.com/info/terms/