2

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 use tmux, I do so after logging into the remote, and am not using tmux on local machine.
    • If I log into the remote and immediately start tmux, both in-shell and when using vim, I am not affected by the issue; however, if I open vim outside of tmux, then tmux starts experiencing the issue (normal shell and when using vim within it)

  • vim:
    Scrolling in vim also shows issues like the above, but I assume if clear/reset are fixed, then this possibly gets fixed too
    • I've tried getting rid of .vimrc, but it changed nothing

  • Clear, reset, printf '\[e[:
    These and all other workarounds found via a Google search do not work, with the issue not being limited to clear/reset, so please do not provide workarounds for clear/reset, as I need to fix the underlying issue
3
  • Have you checked the terminal config database (termcap or similar), as that's what controls the terminal type selected (e.g.xterm, xterm-256color, screen-256color, etc. with xterm-256color generally being the one to use)
    – JW0914
    Dec 4, 2020 at 14:17
  • I didn't even know terminfo was a thing. Still, while I've read a bit and while I still have no clue on why and how the issue happens, I understood that I can pick a different terminal by setting TERM, so, since xterm-256color is affected too, I set it to screen which is the only one working correctly. I assume it's going to be fine since it's what tmux uses anyway.
    – Dirich
    Dec 4, 2020 at 18:05
  • Ubuntu uses a different terminal config database config, however I forget which one, as it's not 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 for tmux seems the most likely.
    – JW0914
    Dec 4, 2020 at 18:08

0

You must log in to answer this question.

Browse other questions tagged .