aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2014-04-20 23:27:06 -0400
committerJesse Luehrs <doy@tozt.net>2014-04-20 23:27:06 -0400
commita655e2995cd252c7edc42776dd538e845643e1d5 (patch)
tree16a401630b254da3257879ece3a0b1add699cdd2
parentd417a3909f0e2340631d073be126509e1eac1fca (diff)
downloadrunes-a655e2995cd252c7edc42776dd538e845643e1d5.tar.gz
runes-a655e2995cd252c7edc42776dd538e845643e1d5.zip
allow multi-word commands
-rw-r--r--src/pty-unix.c7
1 files changed, 6 insertions, 1 deletions
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);