Correctly render on terminals without BCE (fixes #56 github issue)

This commit is contained in:
Keith Winstein
2012-03-16 13:17:28 -04:00
parent 57d97209c0
commit c896055d15
3 changed files with 22 additions and 4 deletions
+6 -2
View File
@@ -244,12 +244,15 @@ void Display::put_cell( bool initialized, FrameState &frame, const Framebuffer &
assert( frame.x + clear_count <= f.ds.get_width() );
bool can_use_erase = has_bce || (cell->renditions == initial_rendition());
/* can we go to the end of the line? */
if ( frame.x + clear_count == f.ds.get_width() ) {
if ( (frame.x + clear_count == f.ds.get_width())
&& can_use_erase ) {
frame.append( "\033[K" );
frame.x += clear_count;
} else {
if ( has_ech ) {
if ( has_ech && can_use_erase ) {
if ( clear_count == 1 ) {
frame.append( "\033[X" );
} else {
@@ -258,6 +261,7 @@ void Display::put_cell( bool initialized, FrameState &frame, const Framebuffer &
}
frame.x += clear_count;
} else { /* no ECH, so just print a space */
/* unlike erases, this will use background color irrespective of BCE */
frame.append( " " );
frame.cursor_x++;
frame.x++;