pkgsrc/misc/dt/patches/patch-ac
fredb f5134e1564 Programs that follow Digital's recommendations will follow ESC(0 -- to
load the DEC Special Graphics (VT line draw) characters into graphics set
GS0 -- with lock shift 0, aka LS0, aka SO, aka ^0 -- to then enable GS0.
Since GS0 is the default, the full procedure is really only necessary when
displaying line draw and alphanumeric characters on the same line. With the
last patch to enable line draw characters, ESC(0 was always taken to mean
ASCII SI (shift in), and ^0 was always taken to to mean SO (shift out),
so for programs that did the right thing (e.g. "pstree"), "dt" was simply
setting, then unsetting, the alternate character set attribute, causing
the desired line draw characters never to be displayed.

To deal with that, introduce a layer of abstraction, such that ESC(0
and friends now only set per-VT variables, rather than directly set the
attribute. Initialize these variables so that SO and SI, taken alone, will
do the expected thing, and extend the state machine so that a changed GS0
will become active at the next carriage return, or immediately if an LS0
was already seen on that line (all very much like a real VT).

Bump version to dt-1.1.7nb2.
2002-02-11 18:30:21 +00:00

45 lines
1.2 KiB
Text

$NetBSD: patch-ac,v 1.3 2002/02/11 18:30:22 fredb Exp $
--- vt.h.orig Mon Feb 11 11:13:44 2002
+++ vt.h
@@ -5,7 +5,7 @@
*/
#define VT_MAXVT 9
-#define VT_MAXCOLS 132
+#define VT_MAXCOLS 224
#define VT_MAXROWS 100
#define VT_POOLSIZE (VT_MAXVT * (VT_MAXROWS + 1))
@@ -20,6 +20,7 @@
#define T_REVERSE 0x04
#define T_SELECTED 0x08
#define T_INSERT 0x10
+#define T_LINEDRAW 0x20
/* Cursor types */
#define C_BLOCK 0x01
@@ -49,6 +50,10 @@
#define SETBG(x,c) ((x) = ((x) & 0x0F) | ((c) << 4))
#define SETCOLOR(x,f,b) ((x) = (f) | ((b) << 4))
+/* Character sets */
+#define S_ASCII 0x00 /* ASCII Graphics (normal) */
+#define S_LINEDRAW 0x01 /* DEC Special Graphics */
+
struct vt_s {
/* Scrollback information */
int line[VT_POOLSIZE]; /* Lines in the scrollback pool */
@@ -87,6 +92,12 @@
int pars[VT_MAXPARS]; /* VT100 parameters */
int ques; /* If ? in VT100 string */
u_int tab_stop[5]; /* Bit field for tab stops */
+
+ /* Graphics set information */
+ int gset0; /* Character set loaded into GS0 */
+ int gset0changed; /* GS0 loaded, but not active */
+ int gset0mapped; /* GS0 loaded and active */
+ int gset1; /* Character set loaded into GS1 */
};
extern struct vt_s vt[VT_MAXVT];