www.thorko.de Thorsten Kohlhepp - Systems administrator | Screen

 

Some useful hints when using screen the terminal multiplexer

Use a customized status bar at the bottom of the screen session

Create a .screenrc file in your homedirectory which contains

hardstatus lastline "%-Lw%{= BW}%50>%n%f* %t%{-}%+Lw%<%=%m/%d %c " 
hardstatus on
hardstatus alwayslastline

 

Change the title of the window to the hostname currently logged in

 Use the above .screenrc file and put in your .bashrc

case "$TERM" in
screen)
  PROMPT_COMMAND='echo -ne "\033k$HOSTNAME\033\\"'
  ;;
esac

Set screen titlebar dynamically to the current working directory

case "$TERM" in
screen)
PROMPT_COMMAND='echo -ne "\033k${PWD}\033\\"'
;;
esac

Share a screen session between different users

chmod u+s /usr/bin/screen
chmod 0755 /var/run/screen

Start a screen session and

CTRL-A :multiuser on
CTRL-A :acladd <user to allow>

After you've done this you can use another user and do

screen -x <user above>/<session name>

When you do something like "su - <other user>" you'll get an error "Cannot open your terminal"

The following hack will fix this

script /dev/null
screen -x user/session

Use your scroll bar of xterm or konsole

termcapinfo xterm* ti@:te@

 

2011-12-19 3:15 pm

Comments (0)





Allowed tags: <b><i><br>Add a new comment: