X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=st.c;h=33a1501403e6d83fe11d0ccaa773e9b363f01c76;hb=b7a7f171effb301ce8dbce07c1c77a6b06ef980f;hp=ba44b1ccf7f04c0238d65652d6b3404aadd555c5;hpb=bffa6e5cc612dcead2d6ff3803ec72cb69c151bd;p=st.git diff --git a/st.c b/st.c index ba44b1c..33a1501 100644 --- a/st.c +++ b/st.c @@ -72,6 +72,8 @@ #define X2COL(x) (((x) - BORDER)/xw.cw) #define Y2ROW(y) (((y) - BORDER)/xw.ch) +#define VT102ID "\033[?6c" + enum glyph_attribute { ATTR_NULL = 0, ATTR_REVERSE = 1, @@ -1181,7 +1183,7 @@ tmoveto(int x, int y) { void tsetchar(char *c) { - char *vt100_0[62] = { /* 0x41 - 0x7e */ + static char *vt100_0[62] = { /* 0x41 - 0x7e */ "↑", "↓", "→", "←", "█", "▚", "☃", /* A - G */ 0, 0, 0, 0, 0, 0, 0, 0, /* H - O */ 0, 0, 0, 0, 0, 0, 0, 0, /* P - W */ @@ -1510,6 +1512,10 @@ csihandle(void) { DEFAULT(csiescseq.arg[0], 1); tmoveto(term.c.x, term.c.y+csiescseq.arg[0]); break; + case 'c': /* DA -- Device Attributes */ + if(csiescseq.arg[0] == 0) + ttywrite(VT102ID, sizeof(VT102ID) - 1); + break; case 'C': /* CUF -- Cursor Forward */ case 'a': DEFAULT(csiescseq.arg[0], 1); @@ -1933,6 +1939,10 @@ tputc(char *c, int len) { } term.esc = 0; break; + case 'Z': /* DECID -- Identify Terminal */ + ttywrite(VT102ID, sizeof(VT102ID) - 1); + term.esc = 0; + break; case 'c': /* RIS -- Reset to inital state */ treset(); term.esc = 0;