if (tgetflag("ut") > 0) tty->cap.f |= TCF_BCE;
- t = tgetstr("pc", &capcur); PC = t ? *t : 0;
+ t = tgetstr("pc", &capcur); tty->cap.pc = t ? *t : 0;
SETDIM(defwd, "COLUMNS", tgetnum("co"), 80);
SETDIM(defht, "LINES", tgetnum("li"), 25);
#ifdef USE_TERMCAP
render->old_bc = BC; BC = 0;
render->old_up = UP; UP = 0;
+ render->old_pc = PC; PC = tty->cap.pc;
#endif
if (!ioctl(fileno(tty->fp), TIOCGWINSZ, &wsz))
#ifdef USE_TERMCAP
UP = render->old_up;
BC = render->old_bc;
+ PC = render->old_pc;
#endif
}
const char *cr, *nw, *up, *ce, *cd; /* cursor motion */
const char *mr, *md, *me; /* reverse video, bold */
const char *af, *ab, *op; /* colour */
+ char pc; /* pad character (termcap) */
} cap;
unsigned defwd, defht; /* default width and height */
};
#define PROGRESS_TTYINFO_INIT \
- { 0, 0, 0, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, 80, 25 }
+ { 0, 0, 0, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, 80, 25 }
struct progress_state {
struct progress_ttyinfo tty; /* terminal state */
char *tempbuf; size_t tempsz; /* scratch buffer */
size_t leftsz, rightsz; /* left and right cursors */
unsigned leftwd, rightwd; /* left and right widths */
- char *old_bc, *old_up; /* old fixup strings */
+ char *old_bc, *old_up, old_pc; /* saved `termcap' globals */
};
struct progress_item {