mirror of
https://github.com/YuzuZensai/Termix.git
synced 2026-11-12 15:46:35 +00:00
22 lines
492 B
JavaScript
22 lines
492 B
JavaScript
function resolveLocalShell(platform, requestedShell, env = process.env) {
|
|||
|
|
if (platform === "win32") {
|
||
|
|
if (requestedShell === "wsl") {
|
||
|
|
return { file: "wsl.exe", args: [] };
|
||
|
|
}
|
||
|
|
return {
|
||
|
|
file: env.TERMIX_LOCAL_SHELL || "powershell.exe",
|
||
|
|
args: ["-NoLogo"],
|
||
|
|
};
|
||
|
|
}
|
||
|
|
|
||
|
|
return {
|
||
|
|
file:
|
||
|
|
env.TERMIX_LOCAL_SHELL ||
|
||
|
|
env.SHELL ||
|
||
|
|
(platform === "darwin" ? "/bin/zsh" : "/bin/bash"),
|
||
|
|
args: ["-l"],
|
||
|
|
};
|
||
|
|
}
|
||
|
|
|
||
|
|
module.exports = { resolveLocalShell };
|