From a655e2995cd252c7edc42776dd538e845643e1d5 Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Sun, 20 Apr 2014 23:27:06 -0400 Subject: allow multi-word commands --- src/pty-unix.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/pty-unix.c b/src/pty-unix.c index 643c5ba..bc1b8ba 100644 --- a/src/pty-unix.c +++ b/src/pty-unix.c @@ -58,7 +58,12 @@ void runes_pty_backend_spawn_subprocess(RunesTerm *t) unsetenv("LINES"); unsetenv("COLUMNS"); - execlp(cmd, cmd, (char *)NULL); + if (strchr(cmd, ' ')) { + execlp("/bin/sh", "/bin/sh", "-c", cmd, (char *)NULL); + } + else { + execlp(cmd, cmd, (char *)NULL); + } fprintf(old_stderr, "Couldn't run %s: %s\n", cmd, strerror(errno)); exit(1); -- cgit v1.2.3-54-g00ecf