You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Sep 23, 2026. It is now read-only.
On macOS, Ctrl+V image paste intermittently no-ops in 2.0.0 (regression from 0.43.x). The keystroke reaches the process (verified at PTY level). Root cause in readClipboardMedia(): on darwin it first resolves clipboard file paths via osascript (JXA, 1 s timeout); when the clipboard has file-like flavors but path resolution yields no media, lookedFileLike === true causes an early return null — the raw image bytes still on the clipboard are never tried, and the paste fails silently. Suggest falling back to native image read, surfacing an error, and raising the osascript timeout.
使用的 Kimi Code CLI 版本 / What version are you running?
kimi 2.0.0(darwin-arm64 单文件版,2026-09-17 通过
kimi upgrade升级)电脑平台 / Platform
macOS 26(Darwin 25.x),Apple Silicon
问题描述 / What issue are you seeing?
剪贴板里有图片时按
Ctrl+V,偶发性完全没反应:不出现[image #N]占位符,也没有任何报错。0.43.x(Python 版)一直正常,升级到 2.0.0 后立刻出现。系统终端(Terminal.app)和 JetBrains IDE 内置终端都能复现,JetBrains 终端里失败率明显更高。复现步骤 / Steps to reproduce
kimi(2.0.0),在输入框按Ctrl+V。已做的排查(排除终端问题)
Ctrl+V,进程能收到0x16字节——按键确实送达了,终端没有吞键。CSI ? u查询无响应),与协议差异无关。env -u TERM_PROGRAM -u COLORTERM TERMINAL_EMULATOR=JetBrains-JediTerm kimi),粘贴图片正常。@mariozechner/clipboard-darwin-arm64),在 IDE 进程树下读图正常(hasImage()返回true)。所以问题在 CLI 自身的粘贴处理逻辑里。
根因分析(读自 2.0.0 二进制内置的 JS 代码)
darwin 平台上
readClipboardMedia()的流程是:osascript -l JavaScript(JXA 读 NSPasteboard 的文件 URL)尝试解析文件路径,超时只有 1 秒(DEFAULT_LIST_TIMEOUT_MS);readClipboardFileMediaViaNativeText(clip):如果剪贴板带有文件类风味(public.file-url、NSFilenamesPboardType、public.url等),就置lookedFileLike = true;lookedFileLike为 true 但没解析出媒体文件,直接return null——剪贴板里仍然存在的原始图片数据(public.png/public.tiff)根本不会被尝试(readClipboardImageViaNative被跳过);handleClipboardImagePaste(),media === null→return false→ 走"按文本粘贴"兜底,对纯图片剪贴板来说就是静默无操作:无占位符、无报错。这能解释所有现象:
Cmd+Ctrl+Shift+4)只有图片数据 → 必成功;从访达/微信/浏览器复制的图片常带文件引用 → 容易失败。0.43.x 是直接读图片字节的,所以当时没有这个问题。
期望的修复 / Expected behavior
readClipboardImageViaNative(),而不是直接返回null;English summary
On macOS,
Ctrl+Vimage paste intermittently no-ops in 2.0.0 (regression from 0.43.x). The keystroke reaches the process (verified at PTY level). Root cause inreadClipboardMedia(): on darwin it first resolves clipboard file paths via osascript (JXA, 1 s timeout); when the clipboard has file-like flavors but path resolution yields no media,lookedFileLike === truecauses an earlyreturn null— the raw image bytes still on the clipboard are never tried, and the paste fails silently. Suggest falling back to native image read, surfacing an error, and raising the osascript timeout.补充
以上调用链读自 2.0.0 darwin-arm64 SEA 二进制内置的 JS bundle(
src/utils/clipboard/clipboard-image.ts、src/tui/controllers/editor-keyboard.ts区段)。如需更多诊断信息可以随时提供。