Softpanorama

May the source be with you, but remember the KISS principle ;-)
Home Switchboard Unix Administration Red Hat TCP/IP Networks Neoliberalism Toxic Managers
(slightly skeptical) Educational society promoting "Back to basics" movement against IT overcomplexity and  bastardization of classic Unix

GNU Screen FAQ

                                                                    jw  21.10.93
								    	05.05.94

   screen: frequently asked questions -- known problems -- unimplemented bugs
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-


Q:   Why is it  impossible to download  a file with Kermit/sz/rz  when  
     screen is running? Do I need to set some special variables?
 
A:   Screen  always   interprets   control-sequences   sent   by   the
     applications   and  translates/optimizes  them  for  the  current
     terminal type.  Screen always  parses  the  user  input  for  its
     escape  character  (CTRL-A).   Both are basic screen features and
     cannot be switched off.  Even  if  it  were  possible  to  switch
     screen into a completely transparent mode, you could never switch
     between windows, while kermit/sz/rz is downloading  a  file.  You  
     must  wait til  the end as  kermit/sz/rz will  not transmit  your 
     input during  a file transfer and as kermit/sz/rz would  be  very  
     confused  if  screen switched  away  the  window  containing  the
     other  kermit/sz/rz.  Simply detach your screen session  for each 
     file transfer and start the  transfer program only from the shell 
     where you started screen. 

Q:   I  am using screen with  a  YYY terminal, which supports  the XXX
     graphic language.  I  am very happy with  it, except one thing: I 
     cannot render graphics into screen windows.
  
A:   You are out of luck there. Screen provides  a fixed set of escape
     sequences in order to make  it possible to switch terminal types.
     Screen has  to know exactly what the escape sequences  do  to the
     terminal because  it  must hold  an  image  in  memory. Otherwise 
     screen could  not  restore  the  image  if  you switch to another 
     window.  Because  of  this  you  have  to  change screens  escape
     sequence parser (ansi.c)  to  pass the XXX graphics sequences  to 
     the terminal.  Of course the graphics will  be lost if you switch
     to  another window. Screen  will only  honour graphics  sequences 
     that are demanded by an overwhelming majority.

Q:   For some unknown reason, the  fifo  in  /tmp/screens/S-myname  is
     gone,  and  i  can't  resume my screen session. Is there a way to
     recreate the fifo?
 
A:   Screen checks the fifo/socket  whenever  it  receives  a  SIGCHLD
     signal.  If missing, the fifo/socket is recreated then. If screen
     is  running  non  set-uid  the  user  can  issue  a  'kill  -CHLD
     screenpid'  directly (it is -CHILD on some systems). Screenpid is
     the process-id of the screen process found in a 'ps -x'  listing.
     But  usually  this won't work, as screen should be installed set-
     uid root. In this case you will not be able to send it a  signal,
     but  the  kernel  will.  It  does  so, whenever a child of screen
     changes its state. Find the process-id (shellpid  below)  of  the
     "least  important"  shell  running  inside  screen. The try 'kill
     -STOP shellpid'.  If the fifo/socket does not  reappear,  destroy
     the  shell  process.  You  sacrify one shell to save the rest. If
     nothing works, please do  not  forget  to  remove  all  processes
     running in the lost screen session.

Q:   When you start "screen" a page of text comes up to  start  you
     off.   Is  there  a way to get rid of this text as a command line
     argument or by using a switch of some sort.  
  
A:   Just  put  the following line in your ~/.screenrc:
         startup_message off
     Many peole ask this, although  it  is  in the man page, too :-)

Q:   Start "screen emacs"  and  run   emacs   function   suspend-emacs
     (ctrl-z). The window containing emacs vanishes. 
 
A:   This is a known  bug.  Unfortunatly  there   is   no   easy   fix
     because  this  is specified in the POSIX  standard.  When  a  new
     window is created Screen opens  up  a  new  session  because  the
     window    has    to  get   the  pty  as a controlling terminal (a
     session  can  only  have  one  controlling  terminal).  With  the
     setsid()   call the   process also    creates   a   new   process
     group.  This process  group is orphaned,   because  there  is  no
     process  in   the  session    which is  not   in   the    process
     group.   Now if the process group  leader  (i.e.  your   program)
     gets   a  TTIN/TTOU/TSTP,   POSIX  states that  the  kernel  must
     send   a   KILL signal to the process group because there is   no
     one  left  to  continue  the process.  Even    if   screen  would
     try to restart the program, that would be after it  received  the
     KILL signal which  cannot  be caught  or ignored.
     
     [email protected] (Tom Tromey):  I've  noticed  this  exact
     same problem.  I put this in my .emacs file.  It seems to work:
        
	;; If running under screen, disable C-z.
	(if (and (getenv "STY") (not window-system))
		(global-unset-key "\C-z"))

Q:   Screen gets the terminal size wrong and messes up.
 
A:   Before you start screen: Check with 'stty -a' what  the  terminal
     driver  thinks  about  rows  and  columns.  Check the environment
     variables LINES and COLUMNS.  Then from within screen check  with
     the info command (CTRL-A i) what size screen thinks your terminal
     is. If correcting tty driver setting  and  environment  variables
     does  not help, look up the terminal capability definition. First
     the TERMCAP environment variable. If this is not set, look up the
     terminals  name  as  defined  in the environment variable TERM in
     /etc/termcap or in the terminfo database with untic  or  infocmp.
     There  may  be  :li=...:  and  :co=...:  or even :ll=...: entries
     (cols#... and lines#...  when it's terminfo) defined incorrectly.
     Either  construct  your  own  TERMCAP  environment variables with
     correct settings, use screens terminfo/termcap  command  in  your
     .screenrc  file  or  have  the  database  corrected by the system
     administrator.

Q:   Screen messes up the terminal output when I use my favourite  ap-
     plication. Setting the terminal size does not help.
 
A:   Probably you got the termcap/terminfo entries wrong. Fixing  this
     is  a  three  stage  procedure.  First,  find  out if terminfo or
     termcap is  used.  If  your   system   only   has   /etc/termcap,
     but    not  /usr/lib/terminfo/...   then  you  are using termcap.
     Easy. But if your system has both, then it depends how the appli-
     cation and how  screen  were  linked.  Beware,  if  your applica-
     tion runs on another host via rlogin, telnet  or  the  like,  you
     should check the terminfo/termcap  databases there. If you cannot
     tell if terminfo or termcap is used (or  you  just  want  to   be
     save),   the   do   all  steps  in  stage  3 in parallel for both
     systems (on all envolved hosts).  Second:  Understand  the  basic
     rules  how  screen  does its terminal  emulation.  When screen is
     started or reattached, it relies on the TERM environment variable
     to  correctly  reflect  the  terminal type  you  have  physically
     in front of you. And the entry should either exist in the  system
     terminfo/termcap  database  or  be  specified via the TERMCAP en-
     vironment variable (if screen is using the  termcap  system).  On
     the  other  end,  screen understands one set of control codes. It
     relies on the application using these codes. This means  applica-
     tions   that  run  under screen  must be able to adapt their con-
     trol codes to screen. The application should use the  TERM  vari-
     able  and  termcap or  terminfo  library to find out how to drive
     its terminal. When running under screen, the terminal is  virtual
     and  is  only defined by  the  set  of  control codes that screen
     understands.  The  TERM  variable  is  automatically    set    to
     "screen"  and  the  "screen"-entries  should  exist  in the data-
     bases. If your application uses hardcoded  control  codes  rather
     than  a database, you are  on  your own.  Hint:  The codes under-
     stood by screen are a superset  of  the  very  common  definition
     named  "vt100".  Look  at   the   documentation  of  screen.  The
     codes  are  listed there. Third:  Have  the  entry  "screen"  in-
     stalled  on  all hosts or make sure you  can  live  with "vt100".
     Check the codes sent by your application, when the TERM  variable
     is  set  to "screen". Do not try to set the TERM  variable inside
     screen  to anything other than "screen"  or "vt100"  or  compati-
     ble.  Thus your application can drive screen correctly. Also take
     care that  a good entry is installed  for your physical  terminal
     that   screen   has  to drive.  Even if the entry was good enough
     for your application to drive the terminal  directly, screen  may
     find   flaws,   as  it tries to use other capabilities while  op-
     timizing   the   screen   output.    The    screenrc     commands
     "termcap"  and/or  "terminfo"  may help to fine-tune capabilities
     without calling the supervisor to change the database.

Q:   I cannot configure screen. Sed does not work.
 
A:   The  regular expressions used  in  our  configure scrip  are  too
     complicated for GNU sed version 2.03.  In  this regard it is  bug
     compatible with  Ultrix 3.1 "sed":  GNU  sed  version 2.03  dumps
     core with our configure script.  Try an older release.  E.g. from
     ftp.uni-erlangen.de:/pub/utilities/screen/sed-2.02b.tar.gz

Q:   When reattaching a session  from  a  different  Workstation,  the
     DISPLAY   environment  variable  should be updated. Even ``CTLR-A
     : setenv DISPLAY newhost:0'' does not work as expected.
 
A:   Under unix every process  has its own environment.  The  environ-
     ment  of the SCREEN process can be changed with the `setenv' com-
     mand.  This  however  cannot  affect the   environment   of   the
     shells or applications already running under screen. Subsequently
     spawned processes will reflect the changes.  One should be  aware
     of  this  problem when running applications from very old shells.
     Screen is a means for keeping processes alive.

Q:   About once every 5 times  I ran the program,  rather than getting
     a "screen," I got someone elses IRC output/input.
 
A:   What probably happened is that an IRC process was left running on
     a pseudo tty  in such a way that the  kernel thought  the tty was
     available  for reallocation.   You  can  fix  this  behaviour  by
     applying the SunOS 4.1.x tty jumbo patch (100513-04).
 
Q:   Screen compiled on SunOS 5.3 cannot reattach a detached session.
 
A:   You are  using /usr/ucb/cc, this compiler  is wrong.  Actually it 
     links  with  a  C-library that  mis-interprets dirent.  Try again
     with /opt/SUNWspro/bin/cc!

Q:   The "talk" command does not work when Screen is active.
 
A:   Talk  and several  other programs  rely on entries  in the  Utmp-
     Database  (/etc/utmp).  On some  systems this  Database is  world 
     writable,  on others  it is not.  If it  is not,  screen must  be 
     installed with the appropriate  permissions (user or group s-bit)
     just like any  program that uses  PTYs (rlogin, xterm, ...). When
     screen cannot write to utmp, you will see messages on you display
     which do not belong to any screen window. 
     When screen can update utmp, it is not guaranteed that it does as
     you  expect.  First this depends  on  the config.h  file defining 
     UTMPOK, LOGINDEFAULT, and perhaps CAREFULUTMP.  Second it depends
     on the screenrc files (system wide and per user), if utmp entries
     are done.  Third, you can control  whether windows are logged  in
     with screens ``login'' command.

Q:   Seteuid()  does not work as expected in AIX.  Attempting a multi-
     user-attach results in a screen-panic: "seteuid: not owner".
 
A:   This   is  not  a   screen  problem.   According  to  Kay  Nettle
     ([email protected]) you need the AIX patch PTF 423674.

Q:   When  I  type  cd directory (any directory  or just  blank)  from 
     within one of the windows in screen, the whole thing just freezes
     up.
 
A:   You display the  current working directory  in xterm's title bar,
     This may be caused by hardcoded ESC-sequences in the shell prompt
     or in an cd alias.  In Xterm the coding is 
     		ESC ] n ; string_to_display ^G 
     where n = 1, 2, 3  selects the location of the  displayed string.
     Screen misinterprets  this as the ansi  operating system  comment
     sequence:
     		ESC ] osc_string 
     and waits (according to ansi) for the string terminator
     		ESC \
     Screen versions after 3.5.12 may provide a workaround.

Q:   Mesg or biff cannot be turned on or off while running screen.
 
A:   Screen failed to change the owner of the pty it uses. You need to
     install screen setuid-root. See the file INSTALL for details.

Q:   The cursor left key deletes the characters instead of just moving the
     cursor. A redisplay (^Al) brings everything back.

A:   Your terminal emulator treats the backspace as "destructive". You
     can probably change this somewhere in the setup. We can't think
     of a reason why anybody would want a destructive backspace, but
     if you really must have it, add the lines
	termcap   'bc@:bs@'
	terminfo  'bc@:bs@'
     to your ~/.screenrc (replace  with the terminal type your
     emulator uses).

Q:   I have an old SysV OS (like Motorola SysV68) and sometimes screen
     doesn't reset the attributes correctly. A redisplay (^Al) doesn't
     make things better.

A:   The libcurses library has a bug if attributes are cleared with
     the special ue/se capabilities. As a workaround (other than upgrading
     your system) modify 'rmul' (and 'rmso'?) in screen's terminfo entry:
	rmul=\E[m, rmso=\E[m



Etc

Society

Groupthink : Two Party System as Polyarchy : Corruption of Regulators : Bureaucracies : Understanding Micromanagers and Control Freaks : Toxic Managers :   Harvard Mafia : Diplomatic Communication : Surviving a Bad Performance Review : Insufficient Retirement Funds as Immanent Problem of Neoliberal Regime : PseudoScience : Who Rules America : Neoliberalism  : The Iron Law of Oligarchy : Libertarian Philosophy

Quotes

War and Peace : Skeptical Finance : John Kenneth Galbraith :Talleyrand : Oscar Wilde : Otto Von Bismarck : Keynes : George Carlin : Skeptics : Propaganda  : SE quotes : Language Design and Programming Quotes : Random IT-related quotesSomerset Maugham : Marcus Aurelius : Kurt Vonnegut : Eric Hoffer : Winston Churchill : Napoleon Bonaparte : Ambrose BierceBernard Shaw : Mark Twain Quotes

Bulletin:

Vol 25, No.12 (December, 2013) Rational Fools vs. Efficient Crooks The efficient markets hypothesis : Political Skeptic Bulletin, 2013 : Unemployment Bulletin, 2010 :  Vol 23, No.10 (October, 2011) An observation about corporate security departments : Slightly Skeptical Euromaydan Chronicles, June 2014 : Greenspan legacy bulletin, 2008 : Vol 25, No.10 (October, 2013) Cryptolocker Trojan (Win32/Crilock.A) : Vol 25, No.08 (August, 2013) Cloud providers as intelligence collection hubs : Financial Humor Bulletin, 2010 : Inequality Bulletin, 2009 : Financial Humor Bulletin, 2008 : Copyleft Problems Bulletin, 2004 : Financial Humor Bulletin, 2011 : Energy Bulletin, 2010 : Malware Protection Bulletin, 2010 : Vol 26, No.1 (January, 2013) Object-Oriented Cult : Political Skeptic Bulletin, 2011 : Vol 23, No.11 (November, 2011) Softpanorama classification of sysadmin horror stories : Vol 25, No.05 (May, 2013) Corporate bullshit as a communication method  : Vol 25, No.06 (June, 2013) A Note on the Relationship of Brooks Law and Conway Law

History:

Fifty glorious years (1950-2000): the triumph of the US computer engineering : Donald Knuth : TAoCP and its Influence of Computer Science : Richard Stallman : Linus Torvalds  : Larry Wall  : John K. Ousterhout : CTSS : Multix OS Unix History : Unix shell history : VI editor : History of pipes concept : Solaris : MS DOSProgramming Languages History : PL/1 : Simula 67 : C : History of GCC developmentScripting Languages : Perl history   : OS History : Mail : DNS : SSH : CPU Instruction Sets : SPARC systems 1987-2006 : Norton Commander : Norton Utilities : Norton Ghost : Frontpage history : Malware Defense History : GNU Screen : OSS early history

Classic books:

The Peter Principle : Parkinson Law : 1984 : The Mythical Man-MonthHow to Solve It by George Polya : The Art of Computer Programming : The Elements of Programming Style : The Unix Hater’s Handbook : The Jargon file : The True Believer : Programming Pearls : The Good Soldier Svejk : The Power Elite

Most popular humor pages:

Manifest of the Softpanorama IT Slacker Society : Ten Commandments of the IT Slackers Society : Computer Humor Collection : BSD Logo Story : The Cuckoo's Egg : IT Slang : C++ Humor : ARE YOU A BBS ADDICT? : The Perl Purity Test : Object oriented programmers of all nations : Financial Humor : Financial Humor Bulletin, 2008 : Financial Humor Bulletin, 2010 : The Most Comprehensive Collection of Editor-related Humor : Programming Language Humor : Goldman Sachs related humor : Greenspan humor : C Humor : Scripting Humor : Real Programmers Humor : Web Humor : GPL-related Humor : OFM Humor : Politically Incorrect Humor : IDS Humor : "Linux Sucks" Humor : Russian Musical Humor : Best Russian Programmer Humor : Microsoft plans to buy Catholic Church : Richard Stallman Related Humor : Admin Humor : Perl-related Humor : Linus Torvalds Related humor : PseudoScience Related Humor : Networking Humor : Shell Humor : Financial Humor Bulletin, 2011 : Financial Humor Bulletin, 2012 : Financial Humor Bulletin, 2013 : Java Humor : Software Engineering Humor : Sun Solaris Related Humor : Education Humor : IBM Humor : Assembler-related Humor : VIM Humor : Computer Viruses Humor : Bright tomorrow is rescheduled to a day after tomorrow : Classic Computer Humor

The Last but not Least Technology is dominated by two types of people: those who understand what they do not manage and those who manage what they do not understand ~Archibald Putt. Ph.D


Copyright © 1996-2021 by Softpanorama Society. www.softpanorama.org was initially created as a service to the (now defunct) UN Sustainable Development Networking Programme (SDNP) without any remuneration. This document is an industrial compilation designed and created exclusively for educational use and is distributed under the Softpanorama Content License. Original materials copyright belong to respective owners. Quotes are made for educational purposes only in compliance with the fair use doctrine.

FAIR USE NOTICE This site contains copyrighted material the use of which has not always been specifically authorized by the copyright owner. We are making such material available to advance understanding of computer science, IT technology, economic, scientific, and social issues. We believe this constitutes a 'fair use' of any such copyrighted material as provided by section 107 of the US Copyright Law according to which such material can be distributed without profit exclusively for research and educational purposes.

This is a Spartan WHYFF (We Help You For Free) site written by people for whom English is not a native language. Grammar and spelling errors should be expected. The site contain some broken links as it develops like a living tree...

You can use PayPal to to buy a cup of coffee for authors of this site

Disclaimer:

The statements, views and opinions presented on this web page are those of the author (or referenced source) and are not endorsed by, nor do they necessarily reflect, the opinions of the Softpanorama society. We do not warrant the correctness of the information provided or its fitness for any purpose. The site uses AdSense so you need to be aware of Google privacy policy. You you do not want to be tracked by Google please disable Javascript for this site. This site is perfectly usable without Javascript.

Last modified: March, 12, 2019