I'm working on a remote Ubuntu 20.10 machine [linux version 5.8.0-1011-gcp
] in Google Cloud, built from a basic Ubuntu image, using gnu bash 5.0.17(1)-release
and xterm 353
, and the terminal isn't clearing lines:
- I've tried with an empty
.bashrc
, as well as the default upon user creation:$TERM
values:local (no tmux) - xterm-color local ( tmux) - screen-256color local (no tmux) - remote (no tmux) - xterm-color local (no tmux) - remote ( tmux) - screen local ( tmux) - remote (no tmux) - screen-256color local ( tmux) - remote ( tmux) - screen
- Terminal output:
# Before pressing Enter and typing "dog": cd dir_cat cd dir_2 reset # After pressing Enter and typing "dog": dogdir_cat cd dir_2 reset # Expected behavior after pressing Enter and typing "dog": dog
If I use tmux
, I still get the same behavior, albeit less problematic than when I don't use it, however vim
has the same issue; as such, I would fundamentally infer screen
has the issue too
tmux
:
When I usetmux
, I do so after logging into the remote, and am not usingtmux
on local machine.- If I log into the remote and immediately start
tmux
, both in-shell and when usingvim
, I am not affected by the issue; however, if I openvim
outside oftmux
, thentmux
starts experiencing the issue (normal shell and when usingvim
within it)
- If I log into the remote and immediately start
vim
:
Scrolling invim
also shows issues like the above, but I assume ifclear
/reset
are fixed, then this possibly gets fixed too- I've tried getting rid of
.vimrc
, but it changed nothing
- I've tried getting rid of
Clear
,reset
,printf '\[e[
:
These and all other workarounds found via a Google search do not work, with the issue not being limited toclear
/reset
, so please do not provide workarounds forclear
/reset
, as I need to fix the underlying issue
termcap
or similar), as that's what controls the terminal type selected (e.g.xterm
,xterm-256color
,screen-256color
, etc. withxterm-256color
generally being the one to use)TERM
, so, sincexterm-256color
is affected too, I set it toscreen
which is the only one working correctly. I assume it's going to be fine since it's what tmux uses anyway.termcap
by default. The issue likely resides within whatever one Ubuntu uses, as it's that config that controls clearing of content from the terminal or whether content remains after execution. It very well could be something else, but either that or the config fortmux
seems the most likely.