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
Pressing Ctrl+V crashes with a TypeError when the system clipboard holds non-text data (e.g. a screenshot). The
traceback points to prompt_toolkit internals doing "\n" in text where text is None because pyperclip.paste()
returned None.
Two distinct trigger paths lead to this crash:
Screenshot in clipboard + model doesn't support image input: _try_paste_media() detects the image, prints a
warning, but returns False. The Ctrl+V handler then falls through to the text paste path, where pyperclip.paste()
returns None → TypeError.
Any non-text clipboard content (covered by Crash when clipboard is empty during Ctrl-V paste #1750): pyperclip.paste() returns None regardless of whether
media detection ran, and prompt_toolkit's PyperclipClipboard.get_data() crashes on it.
TypeError: argument of type 'NoneType' is not iterable
What steps can reproduce the bug?
Start kimi-cli with a model that does not support image input
Take a screenshot (so the clipboard holds an image)
Press Ctrl+V in the prompt
What is the expected behavior?
If the model doesn't support images: show the "Image input is not supported" warning and do nothing else (no crash)
If the clipboard simply has no text: silently ignore the paste (no crash)
What version of Kimi Code CLI is running?
kimi, version 1.30.0
Which open platform/subscription were you using?
N/A (reproducible on any platform)
Which model were you using?
No response
What platform is your computer?
Darwin 25.2.0 arm64 arm
What issue are you seeing?
Pressing Ctrl+V crashes with a TypeError when the system clipboard holds non-text data (e.g. a screenshot). The
traceback points to prompt_toolkit internals doing "\n" in text where text is None because pyperclip.paste()
returned None.
Two distinct trigger paths lead to this crash:
warning, but returns False. The Ctrl+V handler then falls through to the text paste path, where pyperclip.paste()
returns None → TypeError.
media detection ran, and prompt_toolkit's PyperclipClipboard.get_data() crashes on it.
TypeError: argument of type 'NoneType' is not iterable
What steps can reproduce the bug?
What is the expected behavior?
Additional information
Related to #1750.
A fix is available at exqqstar/kimi-cli@e2230992
(branch:
fix/clipboard-crash-non-text-paste).Will open a PR once this issue is confirmed.