osc7: initial patch implementation (#154)

* osc7: initial patch implementation

Closes #153

* osc7: avoid redundant use of realpath()

* osc7: fix styling

* Changing position of the OSC7_PATCH toggle in patches.def.h

---------

Co-authored-by: Bakkeby <bakkeby@gmail.com>
This commit is contained in:
Utkarsh Verma 2024-10-15 09:54:45 +02:00 committed by GitHub
parent 3f1a5ed034
commit c4c5113fbd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 136 additions and 11 deletions

18
st.c
View file

@ -2654,6 +2654,11 @@ strhandle(void)
}
}
return;
#if OSC7_PATCH
case 7:
osc7parsecwd((const char *)strescseq.args[1]);
return;
#endif // OSC7_PATCH
case 8: /* Clear Hyperlinks */
return;
case 10:
@ -2856,6 +2861,19 @@ strparse(void)
if (*p == '\0')
return;
/* preserve semicolons in window titles, icon names and OSC 7 sequences */
if (strescseq.type == ']' && (
p[0] <= '2'
#if OSC7_PATCH
|| p[0] == '7'
#endif // OSC7_PATCH
) && p[1] == ';') {
strescseq.args[strescseq.narg++] = p;
strescseq.args[strescseq.narg++] = p + 2;
p[1] = '\0';
return;
}
while (strescseq.narg < STR_ARG_SIZ) {
strescseq.args[strescseq.narg++] = p;
while ((c = *p) != ';' && c != '\0')