mirror of
https://github.com/samsonjs/vibetunnel.git
synced 2026-04-27 15:17:38 +00:00
Revert "really ensures terminals close even for claude"
This reverts commit fd0abeeeee.
This commit is contained in:
parent
a3564f4586
commit
5b7fdac0c2
1 changed files with 31 additions and 17 deletions
|
|
@ -233,14 +233,21 @@ export class ProcessUtils {
|
||||||
// Windows shells have different syntax
|
// Windows shells have different syntax
|
||||||
if (userShell.includes('bash')) {
|
if (userShell.includes('bash')) {
|
||||||
// Git Bash on Windows: Use Unix-style syntax
|
// Git Bash on Windows: Use Unix-style syntax
|
||||||
// Always use -i to ensure aliases work, but append '; exit' for commands
|
if (isCommand) {
|
||||||
const commandStr = isCommand ? `${command.join(' ')}; exit` : command.join(' ');
|
// Non-interactive command execution
|
||||||
|
|
||||||
return {
|
return {
|
||||||
command: userShell,
|
command: userShell,
|
||||||
args: ['-i', '-c', commandStr],
|
args: ['-c', command.join(' ')],
|
||||||
useShell: true,
|
useShell: true,
|
||||||
};
|
};
|
||||||
|
} else {
|
||||||
|
// Interactive shell session
|
||||||
|
return {
|
||||||
|
command: userShell,
|
||||||
|
args: ['-i', '-c', command.join(' ')],
|
||||||
|
useShell: true,
|
||||||
|
};
|
||||||
|
}
|
||||||
} else if (userShell.includes('pwsh') || userShell.includes('powershell')) {
|
} else if (userShell.includes('pwsh') || userShell.includes('powershell')) {
|
||||||
// PowerShell: Use -Command for execution
|
// PowerShell: Use -Command for execution
|
||||||
// Note: PowerShell aliases work differently than Unix aliases
|
// Note: PowerShell aliases work differently than Unix aliases
|
||||||
|
|
@ -259,15 +266,22 @@ export class ProcessUtils {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// Unix shells: Always use -i to ensure aliases work
|
// Unix shells: Choose execution mode based on command type
|
||||||
// But append '; exit' for non-interactive commands to ensure shell exits
|
if (isCommand) {
|
||||||
const commandStr = isCommand ? `${command.join(' ')}; exit` : command.join(' ');
|
// Non-interactive command execution: shell will exit after completion
|
||||||
|
|
||||||
return {
|
return {
|
||||||
command: userShell,
|
command: userShell,
|
||||||
args: ['-i', '-c', commandStr],
|
args: ['-c', command.join(' ')],
|
||||||
useShell: true,
|
useShell: true,
|
||||||
};
|
};
|
||||||
|
} else {
|
||||||
|
// Interactive shell session: use -i for alias support
|
||||||
|
return {
|
||||||
|
command: userShell,
|
||||||
|
args: ['-i', '-c', command.join(' ')],
|
||||||
|
useShell: true,
|
||||||
|
};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue