osc133: initial patch implementation (#127)

* osc133: initial patch implementation

* Specify dependency on reflow or scrollback patch
This commit is contained in:
Utkarsh Verma 2024-10-01 21:35:30 +02:00 committed by GitHub
parent e7bdaa65d7
commit fe065cc366
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 71 additions and 1 deletions

22
st.c
View file

@ -2699,6 +2699,25 @@ strhandle(void)
tfulldirt();
}
return;
#if OSC133_PATCH
case 133:
if (narg < 2)
break;
switch (*strescseq.args[1]) {
case 'A':
term.c.attr.mode |= ATTR_FTCS_PROMPT;
break;
/* We don't handle these arguments yet */
case 'B':
case 'C':
case 'D':
break;
default:
fprintf(stderr, "erresc: unknown OSC 133 argument: %c\n", *strescseq.args[1]);
break;
}
return;
#endif // OSC133_PATCH
}
break;
case 'k': /* old title set compatibility */
@ -3449,6 +3468,9 @@ check_control_code:
}
tsetchar(u, &term.c.attr, term.c.x, term.c.y);
#if OSC133_PATCH
term.c.attr.mode &= ~ATTR_FTCS_PROMPT;
#endif // OSC133_PATCH
term.lastc = u;
if (width == 2) {