detect shell from environment variable
markt markt
2 files changed,
10 insertions(+),
1 deletions(-)
M
ChangeLog
→
ChangeLog
@@ -1,5 +1,8 @@
(Format: Year/Month/Day) Changes for 1.0rc3: +*07/01/24: + * Detect user's shell from environment rather than assuming /bin/sh (Mark) + FbCommands.cc *07/01/21: * Allow transparency in window buttons, so they show the titlebar underneath instead of black (Mark)
M
src/FbCommands.cc
→
src/FbCommands.cc
@@ -143,12 +143,18 @@ }
sprintf(intbuff, "%d", screen_num); + // get shell path from the environment + // this process exits immediately, so we don't have to worry about memleaks + char *shell = getenv("SHELL"); + if (!shell) + shell = "/bin/sh"; + // remove last number of display and add screen num displaystring.erase(displaystring.size()-1); displaystring += intbuff; setsid(); putenv(const_cast<char *>(displaystring.c_str())); - execl("/bin/sh", "/bin/sh", "-c", m_cmd.c_str(), static_cast<void*>(NULL)); + execl(shell, shell, "-c", m_cmd.c_str(), static_cast<void*>(NULL)); exit(0); return pid; // compiler happy -> we are happy ;)