From ab9a6d583b990480a745ad12e979d0898bdf7eff Mon Sep 17 00:00:00 2001 From: Bananymous Date: Fri, 4 Oct 2024 17:24:37 +0300 Subject: [PATCH] Userspace: Set SHELL environment variable in init instead of shell --- userspace/programs/Shell/main.cpp | 3 --- userspace/programs/init/main.cpp | 1 + 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/userspace/programs/Shell/main.cpp b/userspace/programs/Shell/main.cpp index 355c43a4..cb3de0f5 100644 --- a/userspace/programs/Shell/main.cpp +++ b/userspace/programs/Shell/main.cpp @@ -819,9 +819,6 @@ int main(int argc, char** argv) return 1; } - if (argc >= 1) - setenv("SHELL", argv[0], true); - source_shellrc(); new_termios = old_termios; diff --git a/userspace/programs/init/main.cpp b/userspace/programs/init/main.cpp index 1cdd1d74..983afbb4 100644 --- a/userspace/programs/init/main.cpp +++ b/userspace/programs/init/main.cpp @@ -114,6 +114,7 @@ int main() setenv("HOME", pwd->pw_dir, 1); chdir(pwd->pw_dir); + setenv("SHELL", pwd->pw_shell, 1); char shell_path[PATH_MAX]; strcpy(shell_path, pwd->pw_shell);