openclaw - 💡(How to fix) Fix WSL2: clipboard fails on execFile [1 pull requests]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Root Cause

The clipboard module (src/infra/clipboard.ts) uses execFile to run clip.exe. On WSL2, Node.js's child_process.execFile (posix_spawn) cannot spawn Windows PE executables. WSL's binfmt_misc interop only works through shell-based execution.

// fails with ENOENT (not in Linux PATH)
execFile("clip.exe", [], {input: url})
// fails with SIGTERM even with full path
execFile("/mnt/c/Windows/System32/clip.exe", [], {input: url})
// but this works fine (through shell pipe)
exec("echo url | /mnt/c/Windows/System32/clip.exe")

Fix Action

Fixed

Code Example

// fails with ENOENT (not in Linux PATH)
execFile("clip.exe", [], {input: url})
// fails with SIGTERM even with full path
execFile("/mnt/c/Windows/System32/clip.exe", [], {input: url})
// but this works fine (through shell pipe)
exec("echo url | /mnt/c/Windows/System32/clip.exe")

---

{ argv: ["bash", "-c", "cat | /mnt/c/Windows/System32/clip.exe"] },
RAW_BUFFERClick to expand / collapse

Problem

On WSL2, openclaw dashboard fails to copy the token-authenticated URL to the Windows clipboard. The log says "Copied to clipboard" but nothing lands.

Root cause

The clipboard module (src/infra/clipboard.ts) uses execFile to run clip.exe. On WSL2, Node.js's child_process.execFile (posix_spawn) cannot spawn Windows PE executables. WSL's binfmt_misc interop only works through shell-based execution.

// fails with ENOENT (not in Linux PATH)
execFile("clip.exe", [], {input: url})
// fails with SIGTERM even with full path
execFile("/mnt/c/Windows/System32/clip.exe", [], {input: url})
// but this works fine (through shell pipe)
exec("echo url | /mnt/c/Windows/System32/clip.exe")

Suggested fix

Detect WSL and use shell-based execution:

{ argv: ["bash", "-c", "cat | /mnt/c/Windows/System32/clip.exe"] },

Environment

  • OpenClaw: 2026.5.27
  • OS: WSL2 Ubuntu, Linux 6.6.87.2-microsoft-standard-WSL2
  • Node: v22.22.2

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

openclaw - 💡(How to fix) Fix WSL2: clipboard fails on execFile [1 pull requests]