fix: keep windows onboarding logs ascii-safe

This commit is contained in:
Peter Steinberger 2026-03-14 04:46:40 +00:00
parent 7e41ba4cbb
commit ad65778818
No known key found for this signature in database
2 changed files with 21 additions and 1 deletions

View File

@ -60,6 +60,26 @@ describe("onboardCommand", () => {
expect(mocks.runNonInteractiveOnboarding).not.toHaveBeenCalled();
});
it("logs ASCII-safe Windows guidance before onboarding", async () => {
const runtime = makeRuntime();
const platformSpy = vi.spyOn(process, "platform", "get").mockReturnValue("win32");
try {
await onboardCommand({}, runtime);
expect(runtime.log).toHaveBeenCalledWith(
[
"Windows detected - OpenClaw runs great on WSL2!",
"Native Windows might be trickier.",
"Quick setup: wsl --install (one command, one reboot)",
"Guide: https://docs.openclaw.ai/windows",
].join("\n"),
);
} finally {
platformSpy.mockRestore();
}
});
it("defaults --reset to config+creds+sessions scope", async () => {
const runtime = makeRuntime();

View File

@ -77,7 +77,7 @@ export async function onboardCommand(opts: OnboardOptions, runtime: RuntimeEnv =
if (process.platform === "win32") {
runtime.log(
[
"Windows detected OpenClaw runs great on WSL2!",
"Windows detected - OpenClaw runs great on WSL2!",
"Native Windows might be trickier.",
"Quick setup: wsl --install (one command, one reboot)",
"Guide: https://docs.openclaw.ai/windows",