惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

V
V2EX
IT之家
IT之家
博客园 - 叶小钗
雷峰网
雷峰网
T
Tailwind CSS Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
S
SegmentFault 最新的问题
Apple Machine Learning Research
Apple Machine Learning Research
爱范儿
爱范儿
博客园 - 【当耐特】
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
大猫的无限游戏
大猫的无限游戏
Last Week in AI
Last Week in AI
月光博客
月光博客
酷 壳 – CoolShell
酷 壳 – CoolShell
Jina AI
Jina AI
博客园 - Franky
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
宝玉的分享
宝玉的分享
阮一峰的网络日志
阮一峰的网络日志
Hugging Face - Blog
Hugging Face - Blog
博客园 - 司徒正美

Recent Commits to openclaw:main

test: merge chat side-result checks · openclaw/openclaw@ddd2c2a test: merge cron history checks · openclaw/openclaw@f7eb746 test: merge responsive navigation shell checks · openclaw/openclaw@c2e4b47 docs(changelog): add codex oauth fixes · openclaw/openclaw@628e6cd test: merge navigation routing cases · openclaw/openclaw@5d8cecb Tests: mock channel registry bundled fallback · openclaw/openclaw@2b08233 Secrets: avoid broad web search discovery for single plugin config · openclaw/openclaw@a464f59 test: merge config view browser checks · openclaw/openclaw@20cf511 fix(status): align oauth health with runtime · openclaw/openclaw@eed7116 feat: add macOS screen snapshots for monitor preview (#67954) thanks … · openclaw/openclaw@f377db1 fix: report shared auth scopes in hello-ok (#67810) thanks @BunsDev · openclaw/openclaw@0b6c39b Auto-reply: avoid eager bundled route fallback · openclaw/openclaw@3ea1bf4 Tests: narrow session binding contract setup · openclaw/openclaw@54e4e16 fix(macOS): enable undo/redo in webchat composer text input (#34962) · openclaw/openclaw@00951dc Tests: speed up channel setup promotion · openclaw/openclaw@82b529a Docs: refresh agent instructions · openclaw/openclaw@5775fe2 fix(auth): serialize OAuth refresh across agents to fix #26322 (#67876) · openclaw/openclaw@8e79080 test: allow ollama public surface boundary test · openclaw/openclaw@7d4f1a6 Docs: add test performance guardrails · openclaw/openclaw@89706d3 Tests: restore context-engine usage proof · openclaw/openclaw@e4c4f95 Tests: slim context engine runtime coverage · openclaw/openclaw@74c198f ci: retry failed custom checkouts · openclaw/openclaw@0ee5baf test: trim duplicate provider auth onboarding cases · openclaw/openclaw@1ffc02e matrix: fix sessions_spawn --thread subagent session spawning (#67643) · openclaw/openclaw@1ce2596 test: reduce auth choice fixture churn · openclaw/openclaw@857b9cd test: mock health status config boundaries · openclaw/openclaw@9d5ab4a test: mock onboard config io boundary · openclaw/openclaw@299694d test: mock legacy state plugin boundaries · openclaw/openclaw@2713089 test: mock channel install boundaries · openclaw/openclaw@b945248 test: mock doctor preview channel boundaries · openclaw/openclaw@b1a3ad4
fix(exec): prevent shell startup files from overriding da...
openclaw-clo · 2026-04-29 · via Recent Commits to openclaw:main

@@ -46,38 +46,59 @@ describe("getShellConfig", () => {

46464747

if (isWin) {

4848

it("uses PowerShell on Windows", () => {

49-

const { shell } = getShellConfig();

49+

const { shell, args } = getShellConfig();

5050

const normalized = shell.toLowerCase();

5151

expect(normalized.includes("powershell") || normalized.includes("pwsh")).toBe(true);

52+

expect(args).toEqual(["-NoProfile", "-NonInteractive", "-Command"]);

5253

});

5354

return;

5455

}

55565657

it("prefers bash when fish is default and bash is on PATH", () => {

5758

const binDir = createTempCommandDir(tempDirs, [{ name: "bash" }]);

5859

process.env.PATH = binDir;

59-

const { shell } = getShellConfig();

60+

const { shell, args } = getShellConfig();

6061

expect(shell).toBe(path.join(binDir, "bash"));

62+

expect(args).toEqual(["--noprofile", "--norc", "-c"]);

6163

});

62646365

it("falls back to sh when fish is default and bash is missing", () => {

6466

const binDir = createTempCommandDir(tempDirs, [{ name: "sh" }]);

6567

process.env.PATH = binDir;

66-

const { shell } = getShellConfig();

68+

const { shell, args } = getShellConfig();

6769

expect(shell).toBe(path.join(binDir, "sh"));

70+

expect(args).toEqual(["-c"]);

6871

});

69727073

it("falls back to env shell when fish is default and no sh is available", () => {

7174

process.env.PATH = "";

72-

const { shell } = getShellConfig();

75+

const { shell, args } = getShellConfig();

7376

expect(shell).toBe("/usr/bin/fish");

77+

expect(args).toEqual(["--no-config", "-c"]);

78+

});

79+80+

it("uses startup-suppressed args for zsh env shells", () => {

81+

process.env.SHELL = "/bin/zsh";

82+

process.env.PATH = "";

83+

const { shell, args } = getShellConfig();

84+

expect(shell).toBe("/bin/zsh");

85+

expect(args).toEqual(["-f", "-c"]);

86+

});

87+88+

it("uses startup-suppressed args for bash env shells", () => {

89+

process.env.SHELL = "/bin/bash";

90+

process.env.PATH = "";

91+

const { shell, args } = getShellConfig();

92+

expect(shell).toBe("/bin/bash");

93+

expect(args).toEqual(["--noprofile", "--norc", "-c"]);

7494

});

75957696

it("uses sh when SHELL is unset", () => {

7797

delete process.env.SHELL;

7898

process.env.PATH = "";

79-

const { shell } = getShellConfig();

99+

const { shell, args } = getShellConfig();

80100

expect(shell).toBe("sh");

101+

expect(args).toEqual(["-c"]);

81102

});

8210383104

it("falls back to sh on PATH when SHELL is /usr/bin/false", () => {

@@ -93,15 +114,26 @@ describe("getShellConfig", () => {

93114

const binDir = createTempCommandDir(tempDirs, [{ name: "sh" }]);

94115

process.env.SHELL = "/sbin/nologin";

95116

process.env.PATH = binDir;

96-

const { shell } = getShellConfig();

117+

const { shell, args } = getShellConfig();

97118

expect(shell).toBe(path.join(binDir, "sh"));

119+

expect(args).toEqual(["-c"]);

120+

});

121+122+

it("falls back to startup-suppressed bash on PATH when SHELL is a placeholder", () => {

123+

const binDir = createTempCommandDir(tempDirs, [{ name: "bash" }]);

124+

process.env.SHELL = "/usr/bin/false";

125+

process.env.PATH = binDir;

126+

const { shell, args } = getShellConfig();

127+

expect(shell).toBe(path.join(binDir, "bash"));

128+

expect(args).toEqual(["--noprofile", "--norc", "-c"]);

98129

});

99130100131

it("falls back to bare sh when SHELL is a placeholder and no sh is on PATH", () => {

101132

process.env.SHELL = "/usr/bin/false";

102133

process.env.PATH = "";

103-

const { shell } = getShellConfig();

134+

const { shell, args } = getShellConfig();

104135

expect(shell).toBe("sh");

136+

expect(args).toEqual(["-c"]);

105137

});

106138

});

107139