parsed.org

Tips by tag: screenrc

Audible Bell by xinu on Jan 12, 2005 10:13 AM

To switch back and forth between the audible bell and the visual bell, run the following:

C-a C-g
bellkeystrokesscreenscreenrcterminal

Use these screenrc commands to bind specific key sequences to commands outside of the escape sequence (normally C-a). You can bind key combos to commands this way so you don't always have to prefix commands with your escape key sequence:

# Bind Control-PageDown to 'next', Control-PageUp to 'prev'
# to navigate between windows
bindkey ^[[5;5~ prev
bindkey ^[[6;5~ next

# Bind arrow keys Control-Down to 'next', Control-Up to 'prev'
# to navigate between windows
bindkey ^[[1;5A prev
bindkey ^[[1;5B next

(The keycodes for these keys can be obtained by running cat > /dev/null and pressing the desired key combination.)

bindingbindkeycommandsconfigurationescapekeystrokesscreenscreenrc
Change Default Escape Binding by cygnus on Jan 13, 2005 08:59 AM

The default binding is typically C-a. I like to use C-j:

escape "^j^j"

I also like to use C-j l to get a window list instead of C-j ":

bind 'l' windowlist -b
bindbindingescapegotchakeystrokesscreenscreenrcwindowlist
Keeping a Screen Open by cygnus on Jan 23, 2005 02:21 PM

You can use this in your shell dotfile (e.g. ~/.bash_profile, ~/.zshrc) to create a screen session when you log in or reattach to an existing screen:

if [[ $TERM != 'screen' ]] ; then
    if [[ `screen -list | grep -v "No" | awk '$2 { print }' | wc -l` == 0 ]] ; then
        screen
    else
        screen -dr
    fi
fi

This works in bash and zsh.

attachbash_profilebootconfigurationscreenscreenrcsessionshellstartup
Windowlist Caption Alternative by cygnus on Jan 12, 2005 10:06 AM

This caption config line will add a "caption" to the bottom of the screen which will highlight the currently selected screen and show you a list of all the rest. Add it to your ~/.screenrc:

caption always " | %-w%{= BW}%50>%n %t%{-}%+w |%<"
captionconfigurationscreenscreenrc
RSS