Add DA and DECID sequences These sequences are used by the host in order to can detect which kind of terminal is connected. St will answer like a vt102 terminal with this patch. --- st.c | 9 +++++++++ 1 file changed, 9 insertions(+)
Roberto E. Vargas Caballero k0ga@shike2.com
1 files changed,
9 insertions(+),
0 deletions(-)
jump to
M
st.c
→
st.c
@@ -72,6 +72,8 @@ #define TIMEDIFF(t1, t2) ((t1.tv_sec-t2.tv_sec)*1000 + (t1.tv_usec-t2.tv_usec)/1000)
#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,@@ -1510,6 +1512,10 @@ case 'B': /* CUD -- Cursor <n> Down */
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)); + break; case 'C': /* CUF -- Cursor <n> Forward */ case 'a': DEFAULT(csiescseq.arg[0], 1);@@ -1932,6 +1938,9 @@ } else {
tmoveto(term.c.x, term.c.y-1); } term.esc = 0; + break; + case 'Z': /* DECID -- Identify Terminal */ + ttywrite(VT102ID, sizeof(VT102ID)); break; case 'c': /* RIS -- Reset to inital state */ treset();