From c76a967df41ad28a8ef5f1a7f4293334ed094f5e Mon Sep 17 00:00:00 2001 From: "Michael D. Lowis" Date: Thu, 8 Mar 2018 19:39:04 -0500 Subject: [PATCH] tweaked plumb command handling --- st/st.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/st/st.c b/st/st.c index 5e386b0..c1519b3 100644 --- a/st/st.c +++ b/st/st.c @@ -1291,9 +1291,7 @@ brelease(XEvent *e) if (e->xbutton.button == Button2) { selpaste(NULL); } else if (e->xbutton.button == Button3 && !fork()) { - char cmd[100 + strlen(cwd)]; - sprintf(cmd, "(cd %s ; tfetch '%s')", cwd, sel.primary); - exit(execvp( "sh", (char*[]){ "/bin/sh", "-c", cmd, 0 })); + exit(execvp("tfetch", (char*[]){ "tfetch", sel.primary, 0 })); } else if (e->xbutton.button == Button1) { if (sel.mode == SEL_READY) { getbuttoninfo(e); @@ -2567,8 +2565,8 @@ strhandle(void) case ']': /* OSC -- Operating System Command */ switch (par) { case 7: - if (narg > 1 && access(strescseq.args[1], X_OK) != -1) - cwd = strescseq.args[1]; + if (narg > 1 && strescseq.args[1]) + chdir(strescseq.args[1]); return; case 0: case 1: -- 2.51.0