Skip to content

fix(tui): restore WSL clipboard image paste - #2735

Open
ForeverMJ wants to merge 1 commit into
MoonshotAI:mainfrom
ForeverMJ:fix/wsl-clipboard-image
Open

fix(tui): restore WSL clipboard image paste#2735
ForeverMJ wants to merge 1 commit into
MoonshotAI:mainfrom
ForeverMJ:fix/wsl-clipboard-image

Conversation

@ForeverMJ

Copy link
Copy Markdown

Related Issue

Resolve #2722

Problem

Kimi Code running under WSL could not paste screenshots from the Windows
clipboard because the temporary image path was not forwarded across the
WSL interop boundary.

根因现已通过端到端单变量切换确认:

  • 默认环境:稳定失败
  • 仅将 KIMI_WSL_CLIPBOARD_IMAGE_PATH 加入 WSLENV:稳定成功
    因此 Clipboard image paste does not work in WSL #2722 的根因是:Kimi 把临时 PNG 路径放进普通 Linux 环境变量,但 WSL 启动 powershell.exe 时不会自动把该变量传给 Win32 进程。PowerShell 得不到 $path,保存失败;错误随后被转换成 null,TUI 再静默退回普通文本粘贴。

What changed

  • Forward the PowerShell temporary image path through WSLENV with path conversion.
  • Preserve and deduplicate existing WSLENV entries.
  • Fall back to PowerShell when WSLg exposes only unsupported BMP clipboard data.
  • Add regression coverage for WSL environment propagation and BMP-only WSLg clipboards.

Testing

  • Related Vitest suites: 294 tests passed.
  • TypeScript typecheck passed.
  • Type-aware oxlint passed with no warnings or errors.
  • Verified the real WSL PowerShell path returned a PNG from the Windows clipboard.

Checklist

  • [√] I have read the CONTRIBUTING document.
  • [√] I have linked a related issue, or explained the problem above.
  • [√] I have added tests that prove my feature works.
  • [√] Ran gen-changesets skill, or this PR needs no changeset.
  • [√] Ran gen-docs skill, or this PR needs no doc update.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Clipboard image paste does not work in WSL

1 participant