Knowing what GNU screen you're on with .screenrc

by Mike Levin

Saturday, July 30, 2022

Now that I’m introducing the nice people to GNU screen, make it a little more usable with a .screenrc. This file should be put into your ~/ (home) directory named .screenrc. This is just like .vimrc in that it’s an invisible text file serving as a configuration file in your *nix home folder.

# ~/.screenrc
#
# Guy Who Tweaks This File and Adds Foul Language Comments:
#  -- Miles Z. Sterrett <miles.sterrett@gmail.com>
#
# Original Author:         Aaron Schaefer <aaron@elasticdog.com>
# Created:        Sat 05 Aug 2006 06:38:47 PM EDT
#
# Settings used to initialize screen sessions
term screen-256color
# Change default escape sequence from C-a to a backslash
#  escape ``                            # default ^Aa

# Do not display the copyright page
  startup_message off                  # default: on

# Change the number of scrollback lines
  defscrollback 10000                   # default: 100

# Ensure the default shell is the same as the $SHELL environment variable
  shell -$SHELL

# Make navigating between regions easier
  bind s split
  bind j focus down
  bind k focus up

# Make resizing regions easier
  bind = resize =
  bind + resize +1
  bind - resize -1

# Configure status bar at the bottom of the terminal
  hardstatus alwayslastline
  hardstatus string "%{= kb}[ %=%{w}%?%-Lw%?%{C}(%{W}%n*%f %t%?(%u)%?%{C})%{w}%?%+Lw%?%?%= %{b}][%{C} %Y.%m.%d %{W}%0c %{b}]"

# Turn off the visual bell
  vbell off

# End of file