diff --git a/doc/seqs.txt b/doc/seqs.txt index 16bfee26..27f28b91 100644 --- a/doc/seqs.txt +++ b/doc/seqs.txt @@ -122,6 +122,7 @@ x = xterm 123x CSI l = RM, Reset mode 123x CSI ? l = DECRM, DEC reset mode 123x CSI m = SGR, Set Graphic Rendition + CSI ? m = DECSGR, private Set Graphic Rendition 123x CSI n = DSR, Device Status Report 23x 5 = operating status 23x 6 = CPR = cursor position diff --git a/src/state.c b/src/state.c index 302ec0f1..ccc69817 100644 --- a/src/state.c +++ b/src/state.c @@ -1341,6 +1341,29 @@ static int on_csi(const char *leader, const long args[], int argcount, const cha vterm_state_setpen(state, args, argcount); break; + case LEADER('?', 0x6d): // DECSGR + /* No actual DEC terminal recognised these, but some printers did. These + * are alternative ways to request subscript/superscript/off + */ + for(int argi = 0; argi < argcount; argi++) { + long arg; + switch(arg = CSI_ARG(args[argi])) { + case 4: // Superscript on + arg = 73; + vterm_state_setpen(state, &arg, 1); + break; + case 5: // Subscript on + arg = 74; + vterm_state_setpen(state, &arg, 1); + break; + case 24: // Super+subscript off + arg = 75; + vterm_state_setpen(state, &arg, 1); + break; + } + } + break; + case 0x6e: // DSR - ECMA-48 8.3.35 case LEADER('?', 0x6e): // DECDSR val = CSI_ARG_OR(args[0], 0);