this is obsolete doc -- see http://doc.nethence.com/ instead
GNU screen configuration
Installation
Either install it through your distribution's package system, or from source if the package isn't available (like for FreeBSD),
wget ftp://ftp.gnu.org/gnu/screen/screen-4.0.3.tar.gz
tar xzf screen-*.tar.gz
cd screen-*/
./configure --prefix=/usr/local
make
make install
Note. forcing --prefix otherwise it goes to /usr
On BSD systems, add the screen termcap entry,
cd screen-*/
cat terminfo/screencap >> /etc/termcap
Eventually make that handy symlink (or use configure to force the configdir),
cd /etc/
ln -s ../usr/local/etc/screenrc
GNU screen Configuration
Update:
cd /etc/
ls -l screenrc*
mv -i screenrc screenrc.dist
wget pbraun.nethence.com/configs/misc/screenrc
cd ~/
mv -i .screenrc .screenrc.dist
wget pbraun.nethence.com/configs/misc/.screenrc
Configure screen,
cd /etc/
mv screenrc screenrc.dist
vi screenrc
copy/paste,
startup_message off
caption always "%-Lw%{= BW}%50>%n%f* %t%{-}%+Lw%< %{=b BW} %H %{-} %l %c %d/%m/%Y"
bindkey ^[, prev
bindkey ^[; next
shelltitle ""
autodetach on
defscrollback 65000
#screen -t "log" 0 tail -F /var/log/messages
#screen -t "errors" 1 sh -c "tail -F /var/log/httpd/*error*.log"
Ref. http://pbraun.nethence.com/code/misc/screenrc.html
Note. to find out the right keys do bind, just do "cat" in your terminal and type the keys, then "^C".
Note. a similar caption example can be found into screen's manual,
man screen > search for "FLOW-CONTROL" Section. A few lines above you will find the "caption always" examples. Copy/paste the before-last one to /etc/screenrc (with e.g. gpm or putty).
Then root or some admin user,
cd ~/
vi .screenrc
like,
screen -t "log" 0 tail -F /var/log/messages
#screen -t "errors" 1 sh -c "tail -F /var/log/httpd/*error*.log"
If screen windows don't load .profile nor .kshrc, add
shell -/bin/ksh
Note. the '-' prefix is for login shell, like '-l'
Usage
Attach the first detached session it finds,
screen -R
remotely detach and attach locally,
screen -rd
For UTF-8 terminals,
screen -U
To create a new window,
^A c
To switch back to the last used window,
^A a revenir à la dernière fenetre
To switch to another window,
^A <window number>
Note you can use keybindings see the bindkey stuff above.
To move a window,
^A :number 2
To reload screenrc,
^A :source /etc/screenrc
To split the screen,
^A S
To switch to the other part,
^A TAB
To delete all regions but the current one,
^A Q
screen inside screen ?
:escape ^Tt
Alternative
Alternatively, use splitvt (http://www.devolution.com/~slouken/projects/splitvt/),
cd ~/
vi .splitvtrc
like,
#set command_char ^O
#set quote_char ^V
#set switch_char ^W
#set upper_lines 12
run -upper /usr/bin/tail -F /var/log/thttpd.log
run -lower /usr/bin/tail -F /var/log/messages
#set login on
# This next line would override the 'run' statements above
#run /bin/ksh
Additional notes
Irssi configuration : http://pbraun.nethence.com/doc/chat/irssi.html
Cygwin GUN screen : http://web.gccaz.edu/~medgar/screen.html