MVP solution for zsh plugin

Implemented a minimal viable solution for the zsh plugin:
- Checks if the shell is /bin/zsh
- Falls back to bash if not

This approach prioritizes simplicity and reliability over a more general solution to avoid potential errors.
This commit is contained in:
donbuehl
2024-08-26 14:29:24 +02:00
parent be22c0e1f8
commit db77c13552
@@ -51,9 +51,8 @@ case 'ttyd':
// no child processes, restart ttyd to pick up possible font size change
if ($retval != 0) exec("kill ".$ttyd_pid[0]);
}
$userShell = basename(posix_getpwuid(0)['shell']);
$shell = in_array($userShell, ['bash', 'sh', 'zsh', 'fish', 'ksh', 'tcsh', 'dash']) ? $userShell : 'bash';
if ($retval != 0) exec("ttyd-exec -i '$sock' $shell --login");
$shell = posix_getpwuid(0)['shell'] === '/bin/zsh' ? 'zsh' : 'bash';
if ($retval != 0) exec("ttyd-exec -i '$sock' '$shell' --login");
break;
case 'syslog':
// read syslog file