I was concerned about the terminal scroll inside
screen, besides I have configured
altscreen on it only affects some programs, not taking any effect when switching between windows.
printf '\ec' clear the terminal better than the
Ctrl+L or common
clear command, so that I have decided to apply this.
The default termcap for
cl entry is
\E[H\E[J which is the same as
\E[H) followed by
\E[J) you can get this values if you
echo $TERMCAP inside a
I wondered if changing
\Ec would cause the effect I expect, and it does, cheers! But unfortunately it caused a huge side effect: arrow keys stopped working inside
I am still able to navigate using
L keys, so that I see no reason for not working with arrow keys.
I want to avoid to change
.vimrc as it is caused by
screen, and I can run
vim inside an
ssh session so I would have to change the
.vimrc of all machines.
Here is my current
vbell off startup_message off altscreen on termcapinfo xterm* ti@:te@:cl=\Ec #termcapinfo xterm* xn:hs@:cd=\E[J:ho=\E[H
I have been trying some variants, with and without
ti and so on, but the problem seen to be
cl itself, if its value is
\E[H\E[J it works, otherwise don't.
To reproduce the problem write the file
$HOME/.screenrc with the content above and start a session with for instance
screen -ADRS profile, and then try to
vim .screenrc, you can see you won't be able to navigate using key arrows on keyboard, only
Screen version 4.03.01 (GNU) 28-Jun-15 VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Nov 24 2016 16:44:48)
Is it possible to have the same behaviour as clearing with
\Ec and keep the
Note1: as @schily claimed, it isn't necessarily a
termcap problem, but maybe a
terminfo, but either way I'm using
termcapinfo statement on my
.screenrc that according the manual apply the tweak rule for both
terminfo, I'm not an expert on
termcap/info, I just want to solve this.
:set term=linux make it works, but as I have stated before I would like to avoid changing
Note3: it affects
less as well, and probably others, one more enforcement regarding being a
Note4: I filed a bug: https://savannah.gnu.org/bugs/?54317