This is a git repository to hold the settings files for GNU screen. It contains four different branches;
- One that is generic (
main
) - One that is specific to macOS (
macos
) - One that is specific to Linux-based computers, where the user has access like a personal computer (
linux-local
) - And one that is specific to Linux clusters, using SLURM manager (
slurm
)
The difference of four three branches is that they contain a different screenrc
file. Additionally,
the macos
, linux-local
, and slurm
branches, contain some extra files to be used with the backtick
command of
GNU Screen.
The README
file at each branch, offers detailed information about the peculiarities of the branch.
Before you start, make sure that you have a back up of your current .screenrc
file, by doing
$ mv ~/.screenrc ~/.screenrc_bak
To use the files in this branch of the repository, clone the current branch to your home directory by doing
$ git clone [email protected]:dr-costas/myscreen_files.git
Then, change the name of the created directory, so you will not see it (as it happens by default with
the .screenrc
file), by doing
$ mv ~/myscreen_files ~/.myscreen_files
Finally, add a symbolik link of the myscreen_files/screenrc
file where GNU Screen expects to find it,
by doing
$ ls -s ~/.myscreen_files/screenrc ~/.screenrc
The screenrc
of this branch consists of the following sections:
- Deactivation of the start-up message
- Definition of Vim-like navigation between windows
- Similar, Vim-like, resizing of windows
- Setting-up of hardstatus
- Small fixes for appearance
- Declaration of color handling
- Activation/deactivation of hardstatus line
All the above are explained in the following sections.
This is performed with the line:
startup_message off
The normal behavior would be to have a message like:
GNU Screen version 4.08.00 (GNU) 05-Feb-20
Copyright (c) 2018-2020 Alexander Naumov, Amadeusz Slawinski Copyright (c) 2015-2017 Juergen Weigert, Alexander Naumov, Amadeusz Slawinski Copyright (c) 2010-2014 Juergen Weigert, Sadrul Habib Chowdhury Copyright (c) 2008-2009 Juergen Weigert, Michael Schroeder, Micah Cowan, Sadrul Habib Chowdhury Copyright (c) 1993-2007 Juergen Weigert, Michael Schroeder Copyright (c) 1987 Oliver Laumann
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program (see the file COPYING); if not, see https://www.gnu.org/licenses/, or contact Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA.
Send bugreports, fixes, enhancements, t-shirts, money, beer & pizza to [email protected]
If you want disable this message, then you should use the above mentioned command for screen in
the screenrc
.
With the current screenrc
file, the navigation between the different split windows, happens with
Vim-like key mappings. That is
j
is for down,k
for up,l
for right, andh
for left
To do the navigation, the command/control sequence of GNU Screen has to be pressed first, i.e.
ctrl-a j
to go down.
This Vim-like navigation, is set by the commands:
bind j focus down # Ctl-a j goes down
bind k focus up # Ctl-a k goes up
bind l focus right # Ctl-a l goes right
bind h focus left # Ctl-a h goes left
When having multiple windows in the same time, in any combination of vertical and horizontal
splitting, you can resize them using (again) Vim-like key combinations. The difference with
the navigation is that at the resizing, the j
, k
, l
, and h
, have to be capital case.
That is,
ctrl-a J
resizes the window and does not navigate you (notice the J
).
The full list of resizing combinations is
bind L resize -h +10 # Increase horizontally by 10
bind H resize -h -10 # Decrease horizontally by 10
bind K resize -v +10 # Increase vertically by 10
bind J resize -v -10 # Decrease vertically by 10
You change the step size (i.e. the 10
) at will.
The setting up of the hardstatus is done by the lines
hardstatus off
hardstatus alwayslastline
hardstatus string '%{= .g} %H |%=%{K}%{= w}%?%{K}%-Lw%?%{r}(%{W}%{w}%n%{w}*%f%t%?(%u)%?%{r})%{w}%?%{K}%+Lw%?%= %{g}|%{B} %1` %{g}|%{B} %m-%d %{W}%c %{g} '
In a nutshell, the first line deactivates the default hardstatus, the second makes the hardstatus to be always at last line, and the third defines the form. There are multiple capabilities to use for the form of hardstatus, and this is beyond of the scope of this README. Please refer to the multiple resources online, for adapting the hardstatus form to your tasting.
The screenrc
file of this repository, has some minor fixes for the appearance of GNU Screen. To
be honest, I haven't explicitly tried how these affect the appearance, but I keep using them. Feel
free to experiment and keep them or remove them.
These fixes are at the lines
# Fix for residual editor text
altscreen on
# Fix for Name column in windowlist only show "bash"
windowlist string "%4n %h%=%f"
If you want to use the 256 color terminal emulation of GNU Screen, then you have to declare it.
Note bold that in order to use the 256 colors, you have to have a GNU Screen that is built with 256 colors capabilities. If you do not know how to do this, you can check this blog post (is for macOS, but it stands true for Linux as well).
The line that declares the 256 color support is
term screen-256color
Finally, at the last lines of the screenrc
file, there is a key mapping to activate and
deactivate the appearance of the hardstatus line. These lines are
bind f eval "hardstatus ignore"
bind F eval "hardstatus alwayslastline"
and they indicate that when you use
ctrl-a f
you make the hardstatus line to disappear, and when you use
ctrl-a F
you make the hardstatus line to appear (notice the capital F
).
Enjoy!