aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video
diff options
context:
space:
mode:
authorJan Engelhardt <jengelh@computergmbh.de>2008-04-29 03:59:46 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-04-29 11:06:06 -0400
commitc9e587abfdec2c2aaa55fab83bcb4972e2f84f9b (patch)
tree86ab335b702608c90e9ce3dd759c1c96247a60d5 /drivers/video
parent3265e66b1825942c6e0fc457986cdf941a5f7d37 (diff)
vt: fix background color on line feed
A command that causes a line feed while a background color is active, such as perl -e 'print "x" x 60, "\e[44m", "x" x 40, "\e[0m\n"' and perl -e 'print "x" x 40, "\e[44m\n", "x" x 40, "\e[0m\n"' causes the line that was started as a result of the line feed to be completely filled with the currently active background color instead of the default color. When scrolling, part of the current screen is memcpy'd/memmove'd to the new region, and the new line(s) that will appear as a result are cleared using memset. However, the lines are cleared with vc->vc_video_erase_char, causing them to be colored with the currently active background color. This is different from X11 terminal emulators which always paint the new lines with the default background color (e.g. `xterm -bg black`). The clear operation (\e[1J and \e[2J) also use vc_video_erase_char, so a new vc->vc_scrl_erase_char is introduced with contains the erase character used for scrolling, which is built from vc->vc_def_color instead of vc->vc_color. Signed-off-by: Jan Engelhardt <jengelh@computergmbh.de> Cc: "Antonino A. Daplas" <adaplas@pol.net> Cc: "H. Peter Anvin" <hpa@zytor.com> Cc: Alan Cox <alan@lxorguk.ukuu.org.uk> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/video')
-rw-r--r--drivers/video/console/fbcon.c8
-rw-r--r--drivers/video/console/mdacon.c2
-rw-r--r--drivers/video/console/sticon.c4
-rw-r--r--drivers/video/console/vgacon.c4
4 files changed, 9 insertions, 9 deletions
diff --git a/drivers/video/console/fbcon.c b/drivers/video/console/fbcon.c
index 8eda7b60df8f..ad31983b43eb 100644
--- a/drivers/video/console/fbcon.c
+++ b/drivers/video/console/fbcon.c
@@ -1881,7 +1881,7 @@ static int fbcon_scroll(struct vc_data *vc, int t, int b, int dir,
1881 scr_memsetw((unsigned short *) (vc->vc_origin + 1881 scr_memsetw((unsigned short *) (vc->vc_origin +
1882 vc->vc_size_row * 1882 vc->vc_size_row *
1883 (b - count)), 1883 (b - count)),
1884 vc->vc_video_erase_char, 1884 vc->vc_scrl_erase_char,
1885 vc->vc_size_row * count); 1885 vc->vc_size_row * count);
1886 return 1; 1886 return 1;
1887 break; 1887 break;
@@ -1953,7 +1953,7 @@ static int fbcon_scroll(struct vc_data *vc, int t, int b, int dir,
1953 scr_memsetw((unsigned short *) (vc->vc_origin + 1953 scr_memsetw((unsigned short *) (vc->vc_origin +
1954 vc->vc_size_row * 1954 vc->vc_size_row *
1955 (b - count)), 1955 (b - count)),
1956 vc->vc_video_erase_char, 1956 vc->vc_scrl_erase_char,
1957 vc->vc_size_row * count); 1957 vc->vc_size_row * count);
1958 return 1; 1958 return 1;
1959 } 1959 }
@@ -1972,7 +1972,7 @@ static int fbcon_scroll(struct vc_data *vc, int t, int b, int dir,
1972 scr_memsetw((unsigned short *) (vc->vc_origin + 1972 scr_memsetw((unsigned short *) (vc->vc_origin +
1973 vc->vc_size_row * 1973 vc->vc_size_row *
1974 t), 1974 t),
1975 vc->vc_video_erase_char, 1975 vc->vc_scrl_erase_char,
1976 vc->vc_size_row * count); 1976 vc->vc_size_row * count);
1977 return 1; 1977 return 1;
1978 break; 1978 break;
@@ -2042,7 +2042,7 @@ static int fbcon_scroll(struct vc_data *vc, int t, int b, int dir,
2042 scr_memsetw((unsigned short *) (vc->vc_origin + 2042 scr_memsetw((unsigned short *) (vc->vc_origin +
2043 vc->vc_size_row * 2043 vc->vc_size_row *
2044 t), 2044 t),
2045 vc->vc_video_erase_char, 2045 vc->vc_scrl_erase_char,
2046 vc->vc_size_row * count); 2046 vc->vc_size_row * count);
2047 return 1; 2047 return 1;
2048 } 2048 }
diff --git a/drivers/video/console/mdacon.c b/drivers/video/console/mdacon.c
index bd8d995fe25d..38a296bbdfc9 100644
--- a/drivers/video/console/mdacon.c
+++ b/drivers/video/console/mdacon.c
@@ -531,7 +531,7 @@ static void mdacon_cursor(struct vc_data *c, int mode)
531 531
532static int mdacon_scroll(struct vc_data *c, int t, int b, int dir, int lines) 532static int mdacon_scroll(struct vc_data *c, int t, int b, int dir, int lines)
533{ 533{
534 u16 eattr = mda_convert_attr(c->vc_video_erase_char); 534 u16 eattr = mda_convert_attr(c->vc_scrl_erase_char);
535 535
536 if (!lines) 536 if (!lines)
537 return 0; 537 return 0;
diff --git a/drivers/video/console/sticon.c b/drivers/video/console/sticon.c
index 67a682d6cc7b..a11cc2fdd4cd 100644
--- a/drivers/video/console/sticon.c
+++ b/drivers/video/console/sticon.c
@@ -170,12 +170,12 @@ static int sticon_scroll(struct vc_data *conp, int t, int b, int dir, int count)
170 switch (dir) { 170 switch (dir) {
171 case SM_UP: 171 case SM_UP:
172 sti_bmove(sti, t + count, 0, t, 0, b - t - count, conp->vc_cols); 172 sti_bmove(sti, t + count, 0, t, 0, b - t - count, conp->vc_cols);
173 sti_clear(sti, b - count, 0, count, conp->vc_cols, conp->vc_video_erase_char); 173 sti_clear(sti, b - count, 0, count, conp->vc_cols, conp->vc_scrl_erase_char);
174 break; 174 break;
175 175
176 case SM_DOWN: 176 case SM_DOWN:
177 sti_bmove(sti, t, 0, t + count, 0, b - t - count, conp->vc_cols); 177 sti_bmove(sti, t, 0, t + count, 0, b - t - count, conp->vc_cols);
178 sti_clear(sti, t, 0, count, conp->vc_cols, conp->vc_video_erase_char); 178 sti_clear(sti, t, 0, count, conp->vc_cols, conp->vc_scrl_erase_char);
179 break; 179 break;
180 } 180 }
181 181
diff --git a/drivers/video/console/vgacon.c b/drivers/video/console/vgacon.c
index 6df29a62d720..bd1f57b259d9 100644
--- a/drivers/video/console/vgacon.c
+++ b/drivers/video/console/vgacon.c
@@ -1350,7 +1350,7 @@ static int vgacon_scroll(struct vc_data *c, int t, int b, int dir,
1350 } else 1350 } else
1351 c->vc_origin += delta; 1351 c->vc_origin += delta;
1352 scr_memsetw((u16 *) (c->vc_origin + c->vc_screenbuf_size - 1352 scr_memsetw((u16 *) (c->vc_origin + c->vc_screenbuf_size -
1353 delta), c->vc_video_erase_char, 1353 delta), c->vc_scrl_erase_char,
1354 delta); 1354 delta);
1355 } else { 1355 } else {
1356 if (oldo - delta < vga_vram_base) { 1356 if (oldo - delta < vga_vram_base) {
@@ -1363,7 +1363,7 @@ static int vgacon_scroll(struct vc_data *c, int t, int b, int dir,
1363 } else 1363 } else
1364 c->vc_origin -= delta; 1364 c->vc_origin -= delta;
1365 c->vc_scr_end = c->vc_origin + c->vc_screenbuf_size; 1365 c->vc_scr_end = c->vc_origin + c->vc_screenbuf_size;
1366 scr_memsetw((u16 *) (c->vc_origin), c->vc_video_erase_char, 1366 scr_memsetw((u16 *) (c->vc_origin), c->vc_scrl_erase_char,
1367 delta); 1367 delta);
1368 } 1368 }
1369 c->vc_scr_end = c->vc_origin + c->vc_screenbuf_size; 1369 c->vc_scr_end = c->vc_origin + c->vc_screenbuf_size;