Rendering failure with combined DCH + line scroll

Bug #1498517 reported by Paul "LeoNerd" Evans
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
pangoterm
Fix Released
Medium
Paul "LeoNerd" Evans

Bug Description

$ echo -en "\e[25H\r\nABCDE\b\b\b\e[2P"; echo

renders incorrectly

$ echo -en "\e[25H\r\nABCDE\b\b\b\e[2P"; sleep 2; echo

renders correctly.

Seems just to be a surface GTK problem, because the underlying VTermScreen buffer is fine; using mouse-selection or scrolling away+back re-renders it and now displays correctly.

Changed in pangoterm:
importance: Undecided → Medium
status: New → Confirmed
Revision history for this message
Paul "LeoNerd" Evans (leonerd) wrote :

A little bit of analysis on these (by stderr printfs() in pangoterm.c) reveals some interesting differences between these.

OK case:

BEGIN{
INPUT bytes: 1B 5B 32 35 48 0D 0D 0A 41 42 43 44 45 08 08 08 1B 5B 32 50
MOVERECT 1..25,0..80 -> 0..24,0..80
  blit dirty
DAMAGE 24..25,0..80
  putglyph E
MOVERECT 24..25,4..80 -> 24..25,2..78
  blit dirty
DAMAGE 24..25,78..80
  putglyph E
  blit dirty
}END
BEGIN{
  putglyph E
INPUT bytes: 0D 0A
MOVERECT 1..25,0..80 -> 0..24,0..80
  blit dirty
DAMAGE 24..25,0..80
  blit dirty
}END

FAIL case:

BEGIN{
INPUT bytes: 1B 5B 32 35 48 0D 0D 0A 41 42 43 44 45 08 08 08 1B 5B 32 50 0D 0D 0A
MOVERECT 1..25,0..80 -> 0..24,0..80
  blit dirty
DAMAGE 24..25,0..80
  putglyph E
MOVERECT 24..25,4..80 -> 24..25,2..78
  blit dirty
DAMAGE 24..25,78..80
MOVERECT 1..25,0..80 -> 0..24,0..80
  blit dirty
DAMAGE 24..25,0..80
  blit dirty
}END

What's notable is the number of times a "putglyph E" appears.

Revision history for this message
Paul "LeoNerd" Evans (leonerd) wrote :

UGH. Total red-herring.

Turns out the "OK" case is all because the cursor ends up over that E character while sleeping; the putglyph that forms part of cursor rendering is the one that makes it appear. By fixing the sequence to

  echo -en "\e[25H\r\nABCDE\b\b\b\e[2P\e[C"

It renders just as broken with or without the sleep. So it doesn't seem to be timing related after all.

Revision history for this message
Paul "LeoNerd" Evans (leonerd) wrote :

Progress! By adding even more verbose debugging, I have got it down to the following:

BEGIN{
INPUT bytes: 1B 5B 32 35 48 0D 0D 0A 41 42 43 44 45 08 08 08 1B 5B 32 50 1B 5B 43
MOVERECT 1..25,0..80 -> 0..24,0..80
DAMAGE 24..25,0..80
  putglyph E at (2,24)
MOVERECT 24..25,4..80 -> 24..25,2..78
DAMAGE 24..25,78..80
}END

The 'E' glyph is correctly printed at its final destination position of (2,24), but that happens before the MOVERECT is flushed into it, moving the (currently-blank) (4,24) cell over the top of it, thus making it appear blank.

Revision history for this message
Paul "LeoNerd" Evans (leonerd) wrote :

Fixed by -r654

Changed in pangoterm:
assignee: nobody → Paul "LeoNerd" Evans (leonerd)
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.