mirror of
https://github.com/samsonjs/vibetunnel.git
synced 2026-04-27 15:17:38 +00:00
Fix shell configuration files not being loaded
- Ensure bash, zsh, and fish spawn as login shells to read config files - Add -i and -l flags for bash/zsh, --interactive and --login for fish - Avoid duplicate flags if already present - Add user feedback when starting shells in login mode Fixes #251
This commit is contained in:
parent
7f7b4b682b
commit
9db8fd284b
1 changed files with 22 additions and 3 deletions
|
|
@ -269,12 +269,31 @@ export function resolveCommand(command: string[]): {
|
||||||
|
|
||||||
// Check if this is an interactive shell command
|
// Check if this is an interactive shell command
|
||||||
if (isInteractiveShellCommand(cmdName, cmdArgs)) {
|
if (isInteractiveShellCommand(cmdName, cmdArgs)) {
|
||||||
logger.debug(`Command '${cmdName}' is an interactive shell, adding -i and -l flags`);
|
logger.log(chalk.cyan(`✓ Starting ${cmdName} as login shell to load configuration files`));
|
||||||
// Add both -i (interactive) and -l (login) flags for proper shell initialization
|
// Add both -i (interactive) and -l/--login flags for proper shell initialization
|
||||||
// This ensures shell RC files are sourced and the environment is properly set up
|
// This ensures shell RC files are sourced and the environment is properly set up
|
||||||
|
|
||||||
|
// Don't add flags if they're already present
|
||||||
|
const hasInteractiveFlag = cmdArgs.some((arg) => arg === '-i' || arg === '--interactive');
|
||||||
|
const hasLoginFlag = cmdArgs.some((arg) => arg === '-l' || arg === '--login');
|
||||||
|
|
||||||
|
// Build args array
|
||||||
|
const finalArgs = [...cmdArgs];
|
||||||
|
|
||||||
|
// For fish shell, use --login and --interactive instead of -l and -i
|
||||||
|
const isFish = cmdName === 'fish' || cmdName.endsWith('/fish');
|
||||||
|
|
||||||
|
if (!hasInteractiveFlag) {
|
||||||
|
finalArgs.unshift(isFish ? '--interactive' : '-i');
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!hasLoginFlag) {
|
||||||
|
finalArgs.unshift(isFish ? '--login' : '-l');
|
||||||
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
command: cmdName,
|
command: cmdName,
|
||||||
args: ['-i', '-l', ...cmdArgs],
|
args: finalArgs,
|
||||||
useShell: false,
|
useShell: false,
|
||||||
resolvedFrom: 'path',
|
resolvedFrom: 'path',
|
||||||
originalCommand: cmdName,
|
originalCommand: cmdName,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue