Here's a sensible .screenrc that does the following:
- gives you a useful and hip-looking status line
- tries really hard to enable 256 color support for programs that support it, like Vim
- disables the visual bell and splash screen
- remaps window #0 to be Ctrl+A, `, which feels more natural to me
- Ctrl+A, 0 will now select window #10, which makes more sense to me
- prints a condensed summary of LSF's
bjobs
command in the status line, but only when you're on a cluster node- modify the value of
CLUSTER_NODE_REGEXP
in the helper script to suit your local setup
- modify the value of
If your shell is Bash, here's a one-liner that will grab both the .screenrc and the supporting shell script, preserving a backup of whatever .screenrc you may already have.
# use 'wget -qO - <install-script-url>' if you don't have 'curl'
curl -sL https://gist.github.com/ernstki/188e1731135874d7d69a2f1b9711f9a8/raw/zz_install.sh | bash
Please look at what the installation script does before piping it through bash
. If you don't understand it, or you don't trust it, you can do the installation manually by:
- downloading the raw screenrc-with-lsf-support and zz_bjob_status.sh files yourself
- renaming screenrc-with-lsf-support to ~/.screenrc
- removing the
zz_
part of the shell script's filename, making it executable withchmod a+x
, then putting it somewhere in your$PATH
(all thezz_
nonsense is so that the files in this gist sort in the order I want)
That said, I did test the installation script on my own user account, and everything went well.
If you know already know that PATH variable additions actually probably shouldn't go in ~/.bashrc, then you probably didn't need the installation script. :)
Credit for most of the .screenrc, including the visual appearance, is due to Chris Wills. Bits and pieces of the screen config taken from other places are credited in-place.
For those people who want to know which font is used in the screenshot and all that (there's always one):
- the screenshot of the terminal is PuTTY running in Wine, if that matters to you
- the font is DejaVu Sans Mono, 11 point
- the Vim theme is a customized version of
wombat256mod
I tested in PuTTY (and XTerm) because they tend to be the lowest common denominator for color support.
The shell script is made available under the terms of the MIT license, ©2019, Kevin Ernst.
- the GNU Screen manual
- ChrisWills/.screenrc-main-example - a nice default screenrc, gist.github.com
- I wrote a nice well-documented screenrc... - post from 2005 to screen-users mailing list, lists.gnu.org
- Re: How to Reorder and Set Starting Window Numbers - post from 2009 to screen-users mailing list, lists.gnu.org