diff options
author | Roberto E. Vargas Caballero <k0ga@shike2.com> | 2012-10-06 21:19:56 +0200 |
---|---|---|
committer | Roberto E. Vargas Caballero <k0ga@shike2.com> | 2012-10-06 21:19:56 +0200 |
commit | ffeeb678c5c6c6b895ad494b5b62195dd9893f65 (patch) | |
tree | 64f1c395cf45815587c022baba586e7f7de84e44 /st.c | |
parent | bffa6e5cc612dcead2d6ff3803ec72cb69c151bd (diff) | |
download | st-ffeeb678c5c6c6b895ad494b5b62195dd9893f65.tar.gz st-ffeeb678c5c6c6b895ad494b5b62195dd9893f65.tar.bz2 |
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(+)
Diffstat (limited to 'st.c')
-rw-r--r-- | st.c | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -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, @@ -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)); + break; case 'C': /* CUF -- Cursor <n> Forward */ case 'a': DEFAULT(csiescseq.arg[0], 1); @@ -1933,6 +1939,9 @@ tputc(char *c, int len) { } term.esc = 0; break; + case 'Z': /* DECID -- Identify Terminal */ + ttywrite(VT102ID, sizeof(VT102ID)); + break; case 'c': /* RIS -- Reset to inital state */ treset(); term.esc = 0; |