summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEduardo Chappa <chappa@washington.edu>2021-04-28 21:10:13 -0600
committerEduardo Chappa <chappa@washington.edu>2021-04-28 21:10:13 -0600
commitc8812ee61f137936edfff613f8c475e69326e6a7 (patch)
treeb39c5b611987cf3be7227c689074d88fd180a100
parent3e9f5e0b67a6b74bd5771e92079639a9ff02f194 (diff)
downloadalpine-c8812ee61f137936edfff613f8c475e69326e6a7.tar.xz
* 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.
-rw-r--r--pico/browse.c2
-rw-r--r--pico/composer.c4
-rw-r--r--pico/estruct.h1
-rw-r--r--pico/osdep/terminal.c34
-rw-r--r--pico/osdep/tty.c3
5 files changed, 39 insertions, 5 deletions
diff --git a/pico/browse.c b/pico/browse.c
index b0fb45a..8113e4d 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 ac884f8..5c538de 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 82adbdd..95152b6 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 da98961..3630952 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){
@@ -802,6 +805,16 @@ tinforev(int state) /* change reverse video status */
static int
+tinfoeri(void)
+{
+ if(_xhp && _clearinverse)
+ putpad(_clearinverse);
+
+ return(1);
+}
+
+
+static int
tinfobeep(void)
{
ttputc(BELL);
@@ -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");
@@ -1566,6 +1582,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 */
if(state)
diff --git a/pico/osdep/tty.c b/pico/osdep/tty.c
index 3601d58..c24a8a5 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 */
};
/*