MoonshotAI / MoonshotAI/kimi-code
[Feature Request] tui.toml option to disable inline rendering of pasted images
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 7.5k
- Forks
- 1.2k
- Avg merge
- 11h 53m
- Merged PRs (30d)
- 350
Description
What feature would you like to see?
A TUI preference to disable inline rendering of pasted/attached images as terminal graphics — e.g. a disable_inline_images = true key in tui.toml — so the TUI always falls back to the text placeholder ([Image: name [image/png] 1920x1080]) instead of drawing the picture via the Kitty graphics protocol or iTerm2 OSC 1337.
Right now, whether images render inline is decided once at startup by capability detection that relies purely on terminal environment variables (KITTY_WINDOW_ID, TERM_PROGRAM, WEZTERM_PANE, GHOSTTY_RESOURCES_DIR, ITERM_SESSION_ID, ...). There is no user-facing switch:
tui.tomlhas no such key (onlytheme,disable_paste_burst,[editor],[notifications],[upgrade]are parsed).- No
KIMI_*environment variable controls it either (KIMI_IMAGE_MAX_EDGE_PX/KIMI_IMAGE_READ_BYTE_BUDGETonly affect compression before images are sent to the model, not local display).
The only workarounds are stripping the detection variables at launch (env -u KITTY_WINDOW_ID kimi) or running inside tmux — both have side effects unrelated to image display (e.g. kitten commands stop working in that session).
Use cases:
- Large rendered screenshots are visually disruptive and break scrollback/copy-paste.
- Some terminals render the graphics protocols glitchily or slowly.
- Users who simply prefer the compact text placeholder while still attaching the image for the model.
Proposed behavior: when the option is on, pasted images are still attached and sent to the model exactly as today — only the local preview in the terminal falls back to the text placeholder.
Additional information
- Version: 0.26.0, Linux, kitty terminal (
KITTY_WINDOW_IDset). - Relevant code (as shipped in the binary):
pi-tui/src/terminal-image.ts—detectCapabilities(),renderImage(), and the existingimageFallback()text placeholder, which makes the fallback path look straightforward: forcecaps.imagestonullwhen the preference is set.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with pi-tui/src/terminal-image.ts, reading detectCapabilities(), renderImage(), and imageFallback() to trace how inline display is selected. Add the tui.toml preference and ensure it disables local graphics rendering while image attachments still reach the model. Done means enabled users see the existing text placeholder instead of Kitty or iTerm2 graphics.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- cli
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 76/100