vi refresh issues inside screen

2018-02-18 11:43:33

I have to use a system that requires login via some Citrix/Windows virtualizations to eventually access a RedHat EL 6 system where I'm experiencing some really weird behavior that the admins haven't been able to fix.

Basically, vi and vim both seem to work fine unless I'm using either inside a screen. Once inside the screen, there are serious redraw issues that occur during inserts if I move outside the initial contents displayed (i.e. moved to end or middle of file that is longer than the screen can show, or I scroll down past the bottom a line or two). When this happens, the -- INSERT -- that is drawn at the bottom of the terminal screen pushes everything up a line. If your edits are minor (i.e. not moving around and making many changes on different lines), it's usually OK, but things are redrawn incorrectly (sometimes additional feedback from vi itself scrolls the previous line up one so you end up with two -- INSERT -- lines, or other text) But, if you move around af

  • The issue may be that your screen is configured to use the last line of the terminal window as the hardstatus line, and you open a window in your screenrc before configuring the hardstatus line. Does your screen configuration contain something like this?

    screen 1

    # ...

    hardstatus alwayslastline "..."

    In this case, the window opened by the screen command in the screenrc doesn't have the correct number of lines configured--it doesn't take into account the line used by the hardstatus line. Other windows should be fine, however (compare the output of stty size in the initial window and the window opened by the screenrc).

    I've opened a bug for this issue here. Although it makes some sense in retrospect that the screen command preceding the hardstatus configuration might have this effect, it's pretty unexpected from the user's perspective (many configuration files don't have a notion of sequencing). Also, oddly enough, if you do something like:

    screen 1

    screen 2

    screen 3

    # ...


    2018-02-18 14:00:55