From c8812ee61f137936edfff613f8c475e69326e6a7 Mon Sep 17 00:00:00 2001 From: Eduardo Chappa Date: Wed, 28 Apr 2021 21:10:13 -0600 Subject: * Fix of the list of files in the browser for terminals that need to erase inverse video to stop inverse video. W=Work in collaboration with professor Martin Trusler. --- pico/browse.c | 2 ++ pico/composer.c | 4 ++++ pico/estruct.h | 1 + pico/osdep/terminal.c | 34 ++++++++++++++++++++++++++++++---- pico/osdep/tty.c | 3 ++- 5 files changed, 39 insertions(+), 5 deletions(-) diff --git a/pico/browse.c b/pico/browse.c index b0fb45a9..8113e4dc 100644 --- a/pico/browse.c +++ b/pico/browse.c @@ -2195,6 +2195,8 @@ PaintCell(int row, int col, if(inverted) (*term.t_rev)(1); + else if (*term.t_eri) + (*term.t_eri)(); ucs = utf8_to_ucs4_cpystr(buf2); if(ucs){ diff --git a/pico/composer.c b/pico/composer.c index ac884f89..5c538de1 100644 --- a/pico/composer.c +++ b/pico/composer.c @@ -3405,6 +3405,8 @@ display_delimiter(int state) movecursor(ComposerTopLine - 1, 0); if(state) (*term.t_rev)(1); + else if (*term.t_eri) + (*term.t_eri)(); while(*bufp != '\0') pputc(*bufp++, state ? 1 : 0); @@ -3491,6 +3493,8 @@ InvertPrompt(int entry, int state) movecursor(i, 0); if(state) (*term.t_rev)(1); + else if (*term.t_eri) + (*term.t_eri)(); while(*bufp && *(bufp + 1)) pputc(*bufp++, 1); /* putc up to last char */ diff --git a/pico/estruct.h b/pico/estruct.h index 82adbdd7..95152b6a 100644 --- a/pico/estruct.h +++ b/pico/estruct.h @@ -310,6 +310,7 @@ typedef struct { int (*t_eeop)(void); /* Erase to end of page. */ int (*t_beep)(void); /* Beep. */ int (*t_rev)(int); /* set reverse video state */ + int (*t_eri)(void); /* erase reverse inverse */ } TERM; /* structure for the table of initial key bindings */ diff --git a/pico/osdep/terminal.c b/pico/osdep/terminal.c index da989613..36309520 100644 --- a/pico/osdep/terminal.c +++ b/pico/osdep/terminal.c @@ -71,6 +71,7 @@ static int tinfoeeol(void); static int tinfoeeop(void); static int tinfobeep(void); static int tinforev(int); +static int tinfoeri(void); static int tinfoopen(void); static int tinfoterminalinfo(int); static int tinfoclose(void); @@ -111,7 +112,7 @@ char *_clearscreen, *_moveto, *_up, *_down, *_right, *_left, *_termcap_init, /* string to start termcap */ *_termcap_end, /* string to end termcap */ *_op, *_oc, *_setaf, *_setab, *_setf, *_setb, *_scp; -int _colors, _pairs, _bce; +int _colors, _pairs, _bce, _xhp; char term_name[40]; TERM term = { @@ -129,7 +130,8 @@ TERM term = { tinfoeeol, tinfoeeop, tinfobeep, - tinforev + tinforev, + tinfoeri }; @@ -387,6 +389,7 @@ tinfoterminalinfo(int termcap_wins) _op = tigetstr("op"); _oc = tigetstr("oc"); _bce = tigetflag("bce"); + _xhp = tigetflag("xhp"); _tlines = tigetnum("lines"); if(_tlines == -1){ @@ -801,6 +804,16 @@ tinforev(int state) /* change reverse video status */ } +static int +tinfoeri(void) +{ + if(_xhp && _clearinverse) + putpad(_clearinverse); + + return(1); +} + + static int tinfobeep(void) { @@ -830,6 +843,7 @@ static int tcapeeol(void); static int tcapeeop(void); static int tcapbeep(void); static int tcaprev(int); +static int tcaperi(void); static int tcapopen(void); static int tcapterminalinfo(int); static int tcapclose(void); @@ -868,7 +882,7 @@ char *_clearscreen, *_moveto, *_up, *_down, *_right, *_left, *_termcap_init, /* string to start termcap */ *_termcap_end, /* string to end termcap */ *_op, *_oc, *_setaf, *_setab, *_setf, *_setb, *_scp; -int _colors, _pairs, _bce; +int _colors, _pairs, _bce, _xhp; char term_name[40]; TERM term = { @@ -886,7 +900,8 @@ TERM term = { tcapeeol, tcapeeop, tcapbeep, - tcaprev + tcaprev, + tcaperi }; @@ -1154,6 +1169,7 @@ tcapterminalinfo(int termcap_wins) _op = tgetstr("op", &p); _oc = tgetstr("oc", &p); _bce = tgetflag("ut"); + _xhp = tgetflag("xs"); if (p >= &tcapbuf[TCAPSLEN]){ puts("Terminal description too big!\n"); @@ -1565,6 +1581,16 @@ tcapeeop(void) } +static int +tcaperi(void) +{ + if(_xhp && _clearinverse) + putpad(_clearinverse); + + return(1); +} + + static int tcaprev(int state) /* change reverse video status */ { /* FALSE = normal video, TRUE = reverse video */ diff --git a/pico/osdep/tty.c b/pico/osdep/tty.c index 3601d58e..c24a8a55 100644 --- a/pico/osdep/tty.c +++ b/pico/osdep/tty.c @@ -291,7 +291,8 @@ TERM term = { mswin_eeol, mswin_eeop, mswin_beep, - mswin_rev + mswin_rev, + NULL /* no standout glitch in Windows */ }; /* -- cgit v1.2.3-54-g00ecf