aboutsummaryrefslogtreecommitdiffstats
path: root/pty-unix.c
diff options
context:
space:
mode:
Diffstat (limited to 'pty-unix.c')
-rw-r--r--pty-unix.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/pty-unix.c b/pty-unix.c
index 4a0d3fe..41f86bd 100644
--- a/pty-unix.c
+++ b/pty-unix.c
@@ -24,7 +24,7 @@ void runes_pty_backend_spawn_subprocess(RunesTerm *t)
pty->slave = -1;
}
else {
- char *shell;
+ char *cmd;
setsid();
ioctl(pty->slave, TIOCSCTTY, NULL);
@@ -37,9 +37,12 @@ void runes_pty_backend_spawn_subprocess(RunesTerm *t)
close(pty->slave);
- shell = getenv("SHELL");
- if (!shell) {
- shell = "/bin/sh";
+ cmd = t->cmd;
+ if (!cmd) {
+ cmd = getenv("SHELL");
+ }
+ if (!cmd) {
+ cmd = "/bin/sh";
}
/* XXX should use a different TERM value eventually, but for right now
@@ -48,7 +51,7 @@ void runes_pty_backend_spawn_subprocess(RunesTerm *t)
unsetenv("LINES");
unsetenv("COLUMNS");
- execl(shell, shell, (char *)NULL);
+ execl(cmd, cmd, (char *)NULL);
}
}