Currently, OpenTerminal.php is using a hardcoded 'bash' shell. I propose to add a function that determines the user's actual shell and uses it when opening the terminal.
Proposed Solution
Add a getUserShell() function to OpenTerminal.php that retrieves the user's shell from /etc/passwd. If the shell can't be determined, it should default to 'bash'.
Modify the existing exec call to use the result of getUserShell(). The original line:
if ($retval != 0) exec("ttyd-exec -i '$sock' bash --login");
Description
Currently, OpenTerminal.php is using a hardcoded 'bash' shell. I propose to add a function that determines the user's actual shell and uses it when opening the terminal.
Proposed Solution
Add a
getUserShell()
function to OpenTerminal.php that retrieves the user's shell from /etc/passwd. If the shell can't be determined, it should default to 'bash'.Modify the existing exec call to use the result of
getUserShell()
. The original line:should be changed to:
Here's the proposed function:
Benefits