> scrollback isn't part of wsdisplay_emulops but rather wsdisplay_accessops.
> It isn't clear how to properly get an attr in wsscrollback()
> GETCHAR/getchar is part of wsmoused and sc->sc_accessops->getchar
> may be NULL.
Ok, ignore that. There is a simpler solution.
Index: rasops.c
===================================================================
RCS file: /OpenBSD/src/sys/dev/rasops/rasops.c,v
retrieving revision 1.53
diff -u -p -r1.53 rasops.c
--- rasops.c 27 Apr 2018 21:36:12 -0000 1.53
+++ rasops.c 1 May 2018 17:02:43 -0000
@@ -1373,6 +1373,7 @@ struct rasops_screen {
int rs_visible;
int rs_crow;
int rs_ccol;
+ long rs_defattr;
int rs_sbscreens;
#define RS_SCROLLBACK_SCREENS 5
@@ -1412,10 +1413,11 @@ rasops_alloc_screen(void *v, void **cook
scr->rs_visible = (ri->ri_nscreens == 0);
scr->rs_crow = -1;
scr->rs_ccol = -1;
+ scr->rs_defattr = *attrp;
for (i = 0; i < scr->rs_dispoffset; i++) {
scr->rs_bs[i].uc = ' ';
- scr->rs_bs[i].attr = *attrp;
+ scr->rs_bs[i].attr = scr->rs_defattr;
}
if (ri->ri_bs && scr->rs_visible) {
@@ -1425,7 +1427,8 @@ rasops_alloc_screen(void *v, void **cook
} else {
for (i = 0; i < ri->ri_rows * ri->ri_cols; i++) {
scr->rs_bs[scr->rs_dispoffset + i].uc = ' ';
- scr->rs_bs[scr->rs_dispoffset + i].attr = *attrp;
+ scr->rs_bs[scr->rs_dispoffset + i].attr =
+ scr->rs_defattr;
}
}
@@ -1906,7 +1909,6 @@ rasops_scrollback(void *v, void *cookie,
struct rasops_info *ri = v;
struct rasops_screen *scr = cookie;
int row, col, oldvoff;
- long attr;
oldvoff = scr->rs_visibleoffset;
@@ -1927,7 +1929,7 @@ rasops_scrollback(void *v, void *cookie,
return;
rasops_cursor(ri, 0, 0, 0);
- ri->ri_eraserows(ri, 0, ri->ri_rows, attr);
+ ri->ri_eraserows(ri, 0, ri->ri_rows, scr->rs_defattr);
for (row = 0; row < ri->ri_rows; row++) {
for (col = 0; col < ri->ri_cols; col++) {
int off = row * scr->rs_ri->ri_cols + col +