mirror of
https://github.com/LukeSmithxyz/st.git
synced 2024-11-25 08:25:47 +01:00
-e flag handles arguments.
This commit is contained in:
parent
54bc450dbf
commit
732b9601ed
1 changed files with 7 additions and 3 deletions
10
st.c
10
st.c
|
@ -545,11 +545,15 @@ die(const char *errstr, ...) {
|
||||||
|
|
||||||
void
|
void
|
||||||
execsh(void) {
|
execsh(void) {
|
||||||
char *args[] = {getenv("SHELL"), "-i", NULL};
|
char **args;
|
||||||
|
char *envshell = getenv("SHELL");
|
||||||
|
DEFAULT(envshell, "sh");
|
||||||
|
|
||||||
if(opt_cmd)
|
if(opt_cmd)
|
||||||
args[0] = opt_cmd, args[1] = NULL;
|
args = (char*[]){"sh", "-c", opt_cmd, NULL};
|
||||||
else
|
else
|
||||||
DEFAULT(args[0], SHELL);
|
args = (char*[]){envshell, "-i", NULL};
|
||||||
|
|
||||||
putenv("TERM="TNAME);
|
putenv("TERM="TNAME);
|
||||||
execvp(args[0], args);
|
execvp(args[0], args);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue