diff options
Diffstat (limited to 'st.c')
-rw-r--r-- | st.c | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -545,11 +545,15 @@ die(const char *errstr, ...) { | |||
545 | 545 | ||
546 | void | 546 | void |
547 | execsh(void) { | 547 | execsh(void) { |
548 | char *args[] = {getenv("SHELL"), "-i", NULL}; | 548 | char **args; |
549 | char *envshell = getenv("SHELL"); | ||
550 | DEFAULT(envshell, "sh"); | ||
551 | |||
549 | if(opt_cmd) | 552 | if(opt_cmd) |
550 | args[0] = opt_cmd, args[1] = NULL; | 553 | args = (char*[]){"sh", "-c", opt_cmd, NULL}; |
551 | else | 554 | else |
552 | DEFAULT(args[0], SHELL); | 555 | args = (char*[]){envshell, "-i", NULL}; |
556 | |||
553 | putenv("TERM="TNAME); | 557 | putenv("TERM="TNAME); |
554 | execvp(args[0], args); | 558 | execvp(args[0], args); |
555 | } | 559 | } |