patch: open-selected

This commit is contained in:
2026-01-01 15:07:12 -05:00
parent cef81e7128
commit ff42b9bd86
3 changed files with 27 additions and 0 deletions

10
st.c
View File

@@ -1887,6 +1887,16 @@ csihandle(void)
term.c.y+1, term.c.x+1);
ttywrite(buf, len, 0);
break;
case 7:
if (strstr(strescseq.args[1], "file://") != strescseq.args[1]) {
fprintf(stderr, "erresc: dir %s must have prefix 'file://'\n",
strescseq.args[1]);
return;
}
if (chdir(strescseq.args[1] + 7) != 0) /* +7 to remove prefix */
fprintf(stderr, "erresc: invalid directory %s\n",
strescseq.args[1]);
return;
default:
goto unknown;
}