To do this... | Do this... |
---|---|
Make a new session/reconnect old one | screen -U -dRR sessionname |
Detach session | C-a d |
Split horizontally | C-a S |
Split vertically(!) | C-a | |
Remove this split region | C-a X |
Remove all but this split region | C-a Q |
Jump to next split region | C-a Tab |
New window | C-a c |
List windows | C-a w |
Copy mode/pause | C-a [ |
There are of course more comands that GNU Screen supports, but these are the few that I find to be most useful especially when working over a ssh link, since I can monitor several outputs at the same time. Bear in mind that due to the nature of multiplexing, having split screens/regions can cause a slow connection to appear a tad slower.
2 comments:
I've recently started using screen quite often. I've found it useful to be able to identify by prompt which screen you're in. As such, I've written a script that can do that. Just add this to your .bashrc:
# Fix prompt to prepend screen name when necessary.
pid=`ps -f | awk -v pid="$$" ' $2 == pid { print $3 } '`
scr=`screen -ls | awk -F "." -v pid=$pid ' $1 == pid { print $2 } ' | awk ' { print $1 } '`
if [ -n "$scr" ]; then
PS1="\[\033[32m\]$scr:\[\033[0m\]$PS1";
fi
I hope text formatting is preserved in the comment.
That's nifty, but more often then not I know which screen I am currently on; that's why I use "C-a w". I try to minimise the amount of customisations that I do to a system -- this helps with me being a little more versatile, not forgetting that I have effectively 3 to 5 machines to work with each time.
I don't think the formatting was preserved. I think they really went all out to prevent injected code via comments.
Post a Comment