github ccch1mneyyy/dsh-TUI v0.10.0
v0.10.0 — 终端内图片:缩略图、大图预览与输入框附件(首个 0.10 稳定版)

4 hours ago

dsh-TUI 0.10.0

首个 0.10 稳定版,切自 main@ea88f22b;距 v0.10.0-beta.5 共 84 个提交 / 24 个已合并 PR。本版主线是终端内图片:会话内缩略图、居中大图预览(缩放/平移/切换/打开原图)与输入框图片附件;另含权限切换修复、问卷粘贴、底部滚动修复与鲸鱼娘欢迎期动画。

✨ 新功能

终端内图片(#688 #687 #691 #697 #772 #775 #779 #808

  • 会话内缩略图:用户附件、助手回复、工具结果里的图片(PNG/JPEG/WebP/GIF)在转录区显示为有界等比缩略图,只有图片的消息也带本地化标签;缩略图随滚动按可见区域裁剪,不覆盖输入栏(#691 #775)。
  • 居中大图预览:全屏下点击输入框里的 [Image #N] 或转录区缩略图打开预览,标题为 Image #N — 格式 · 宽×高 · 体积 · 文件名,卡片最多占对话区约 95%;预览打开时对话区内容变淡(前景/背景向终端底色混合一半),输入栏与状态栏保持清晰(#697 #775)。
  • 缩放 / 平移 / 看图导航:「适应」「100%」与 +/- 在 100%、200%、400%、800% 之间切换,拖动、滚轮或方向按钮平移;/ 或底部 / 切换图片(首尾不循环,显示「当前张/总张数」)(#779)。
  • 打开原图:卡片底行的来源路径可用系统看图程序打开附件库里的原始字节——不依赖源文件是否还在,也不重新编码;原图只在点击时导出到私有系统临时目录(#779)。
  • 输入框图片附件Ctrl+V/Alt+V 粘贴图片文件或剪贴板位图会暂存为 [Image #N],发送时变成真正的图片块;token 在输入框里是一个整体——光标不会停在内部、/ 整体跳过、Backspace/Delete/Ctrl+W 整体删除、选区边缘落在其中会扩到整个 token(#697)。
  • 光标跟随预览:光标停在 [Image #N] 起点时自动弹出预览,离开即关;预览期间键盘仍归输入框,方向键可在多张图之间走动、预览随之切换(#697)。
  • 终端兼容与回退:Kitty graphics 与 Sixel 双协议,DSH_TUI_IMAGE_PROTOCOL=auto|kitty|sixel|none 可覆盖;inline、辅助功能模式、多路复用器或探测失败时占用同样布局显示文字元数据(#688 #775)。
  • 性能:缩略图 256 色量化改用 sharp 原生 libimagequant——384×192 缩略图编码 197ms → 3ms(照片 194 → 11ms),并移除 image-q 依赖(node_modules 少约 1.2 MB)(#808)。
  • 插件侧:新增宿主 Image 原语与最多三行的富状态视图(tuiStatus.registerView),插件不接触渲染器/终端写入 API 也能画图(#688)。

其他新功能

  • 默认推理强度 effortDefault#767):/settings 新增「默认推理强度」(auto / off / low / high / max),只决定新会话起始档位,不打扰运行中的 /effort;优先级为 settings 用户层 > cordis effort > 上次 /effort 持久化 > 模型默认。
  • 鲸鱼娘欢迎期动画与点击互动#726 #760):欢迎期闲置时摆鱼鳍、拍尾巴、眨眼,连续空闲 10 秒入睡冒 Z;点击会冒爱心并唤醒它(不依赖设置开关);各动作作为独立图层并行合成。whaleIdle 默认开,可在 /settings 关闭;第一个 agent 任务之后永久定格为标准帧。

🔧 修复

  • /permission 与 Shift+Tab#755):按真实服务的 current(session) 契约读快照,官方 /permission 命令未暴露时回退到 permissionPresets 服务写路径,两条路都不可用时明确报错而不再把命令当普通消息发给模型;动态预设按稳定顺序进入 Shift+Tab,plan 退出后身份正确还原;斜杠菜单/补全等瞬态浮层改为锚定输入簇,不再出现在 todo 面板上方。
  • 问卷与计划评审面板粘贴#786):自定义回答行支持 bracketed 粘贴与 Ctrl+V/Alt+V 读取剪贴板——多行压平为单行、剥除 ANSI/OSC、emoji 不劈半、8000 码点上限;纯换行粘贴不再被当成回车提交,粘贴也不会误触发 plan-review 的数字快选/批准;扩展对话框的输入框同样补上 Ctrl+V
  • 滚到底后继续滚轮仍强拖/闪烁#803):新增底部超滚门控——贴底时向下滚轮直接忽略,不再每格翻转 sticky、闪现「回到底部」或整屏重绘;从上方滚回底部、±1 行面板(/jobs、help)照常工作。
  • 窄屏 todo 面板幽灵空行#763):目标行与折叠头紧贴,被截断的 todo 行不再虚高出行。
  • 图片路径附带修复#691 #697 #775 #779):切换会话或弹出阻塞对话框时关闭图片弹窗并取消在途读取;失效的 [Image #N] 在点击、发送与作为命令参数时给出明确警告;退出时清理剪贴板图片临时目录;审批/问卷/对话框期间输入草稿不再丢失;弹窗换图或缩小后不再残留上一张的边框;macOS 首次解码不再把重复类警告刷到备用屏;浅色主题面板改为纯白底,图片不再带黑色补边。

⚙️ 配置变更

  • 新增设置:terminalImages(终端图片预览,默认开,改后需 /restart)、whaleIdle(欢迎期鲸鱼动画,默认开)、effortDefault(默认推理强度)。
  • 新增环境变量:DSH_TUI_IMAGE_PROTOCOL(协议覆盖)、DSH_TUI_DISABLE_TERMINAL_IMAGES=1(强制关闭预览)、DSH_TUI_TAB_STATUS=1(终端 tab 状态改为显式 opt-in)。

⚠️ 已知限制

  • 图片预览需要 fullscreen + 支持 Kitty graphics 或 Sixel 的终端;其余情况只显示文字元数据(图片仍会正常发给模型)。
  • Sixel 仍为 256 色量化,「100%」指空间像素比例而非无损颜色;「100%」只在终端报告字符格像素尺寸时可用;需要原始色彩或动画时用「打开原图」。
  • 超出解码/编码字节预算的图片保留文字回退(Sixel 单次编码 4 MiB 预算未变)。
  • terminalImages 的改动需要 /restart 生效。
  • Ctrl+V 粘贴覆盖主输入框、问卷/计划评审面板与扩展对话框;Ctrl+R 历史搜索等其余输入面暂未接入。
  • whaleIdle 只在欢迎期生效,第一个 agent 任务后鲸鱼永久定格(点击爱心仍可用)。

🙏 致谢

🚀 升级方式

TUI 内 /update;或 dsh plugin --profile dsh-tui add @deepseek-harness-tui/dsh-tui@latest;用全局 dsh-tui 启动的再执行 npm install -g --legacy-peer-deps @deepseek-harness-tui/dsh-tui@latest


dsh-TUI 0.10.0 (English)

The first 0.10 stable release, cut from main@ea88f22b; 84 commits / 24 merged PRs since v0.10.0-beta.5. The headline is images inside the terminal: transcript thumbnails, a centered full-screen preview (zoom, pan, gallery, open original), and image attachments in the composer — plus a permission-switching fix, questionnaire paste, bottom-scroll fixes, and welcome-phase whale animation.

✨ New features

Terminal images (#688 #687 #691 #697 #772 #775 #779 #808)

  • Transcript thumbnails: images in user attachments, assistant replies and tool results (PNG/JPEG/WebP/GIF) render as bounded, aspect-preserving thumbnails; image-only messages get localized labels. Thumbnails scroll and clip to the visible region without covering the prompt (#691 #775).
  • Centered full-screen preview: in fullscreen, clicking a composer [Image #N] token or a transcript thumbnail opens a preview titled Image #N — format · W×H · size · file name, occupying up to ~95% of the transcript region. The conversation behind it is dimmed (explicit colors blend halfway toward the terminal background) while the prompt and status rows stay clear (#697 #775).
  • Zoom, pan and gallery navigation: "fit" / "100%" / + / - step through 100%, 200%, 400% and 800%; drag, wheel or the direction buttons pan; / or the / buttons switch images (no wrap-around, with a current/total counter) (#779).
  • Open original: the source path on the card's bottom row opens the attachment store's original bytes in the system image viewer — independent of whether the source file still exists, and without re-encoding. Originals are exported to a private OS temp directory only on click (#779).
  • Composer image attachments: images pasted with Ctrl+V/Alt+V (file or clipboard bitmap) are staged as [Image #N] and sent as real image blocks. The token behaves as one unit: the caret never rests inside it, / step over it, Backspace/Delete/Ctrl+W remove it whole, and a selection edge inside it grows to cover it (#697).
  • Caret-following preview: a preview opens automatically while the caret rests at a token's start and closes when it leaves; the keyboard stays with the prompt, so the arrow keys walk from image to image and the preview follows (#697).
  • Terminal support and fallback: Kitty graphics and Sixel are both supported, overridable with DSH_TUI_IMAGE_PROTOCOL=auto|kitty|sixel|none; inline mode, accessibility mode, multiplexers or a failed probe keep the same layout with text metadata (#688 #775).
  • Performance: thumbnail 256-color quantization now uses sharp's native libimagequant — a 384×192 thumbnail encodes in 3 ms instead of 197 ms (photo: 11 ms vs 194 ms) — and the image-q dependency is gone (~1.2 MB less in node_modules) (#808).
  • For plugin authors: a host-owned Image primitive plus bounded rich status views of up to three rows (tuiStatus.registerView), so plugins can draw without touching the renderer or terminal-write APIs (#688).

Other features

  • Default reasoning effort effortDefault (#767): /settings gains a "default reasoning effort" field (auto / off / low / high / max) that only sets the starting level for new sessions and never disturbs a running /effort. Precedence: settings user layer > cordis effort > persisted /effort > model default.
  • Welcome-phase whale animation and click interaction (#726 #760): while idle during the welcome phase the whale flutters its fins, thumps its tail and blinks, and dozes off with Zs after 10 seconds idle; clicking pops a heart and wakes it (independent of the setting). Actions compose as independent layers. whaleIdle is on by default and can be disabled in /settings; the whale freezes to the static frame after the first agent turn.

🔧 Fixes

  • /permission and Shift+Tab (#755): the snapshot now follows the real service contract current(session); when the official /permission command is not exposed to the agent, switching falls back to the permissionPresets service write path, and when neither is available it reports clearly instead of sending the command to the model as a normal message. Dynamic presets join the Shift+Tab cycle in a stable order, plan-mode exit restores the correct identity, and transient pickers/completions are anchored to the input cluster instead of appearing above the todo panel.
  • Paste in questionnaires and plan review (#786): custom answer rows now accept bracketed paste and Ctrl+V/Alt+V clipboard reads — multi-line content is flattened, ANSI/OSC are stripped, emoji are never split, and there is an 8000-code-point cap. A paste of bare newlines is no longer submitted as Enter, and pasting never triggers plan-review quick-select/approve. Extension dialog inputs got Ctrl+V too.
  • Wheel-down at the bottom still "dragged" and flickered (#803): a bottom-overscroll gate now ignores wheel-down while the view is pinned to the bottom — no per-notch sticky flip-flop, no flashing "back to bottom" pill, no full-screen repaint. Scrolling back down from above and ±1-row panels (/jobs, help) behave as before.
  • Ghost blank lines in the todo panel on narrow screens (#763): the goal row sits flush against the fold header and truncated todo rows no longer measure taller than they render.
  • Image-related fixes (#691 #697 #775 #779): the preview closes and in-flight reads are cancelled on session switches or blocking dialogs; stale [Image #N] placeholders warn on click, submit and command arguments; the clipboard image directory is removed at exit; text drafts survive approval/questionnaire/dialog overlays; switching to a differently shaped image no longer leaves the previous card's border behind; macOS no longer prints duplicate-class warnings to the alternate screen on the first decode; light-theme panels are pure white and images no longer carry black letterboxing.

⚙️ Configuration changes

  • New settings: terminalImages (terminal image previews, on by default, takes effect after /restart), whaleIdle (welcome-phase whale animation, on by default), effortDefault (default reasoning effort).
  • New environment variables: DSH_TUI_IMAGE_PROTOCOL (protocol override), DSH_TUI_DISABLE_TERMINAL_IMAGES=1 (force previews off), DSH_TUI_TAB_STATUS=1 (terminal tab status is now explicit opt-in).

⚠️ Known limitations

  • Image previews need fullscreen plus a terminal that supports Kitty graphics or Sixel; otherwise only text metadata is shown (images are still sent to the model).
  • Sixel still quantizes to 256 colors: "100%" is a spatial pixel ratio, not lossless color, and it is only available when the terminal reports cell pixel dimensions. Use "open original" for true color or animation.
  • Images beyond the decode/encode byte budget fall back to text (the 4 MiB single Sixel encode budget is unchanged).
  • Changing terminalImages requires /restart.
  • Ctrl+V paste covers the main prompt, questionnaire/plan-review panels and extension dialogs; other input surfaces such as Ctrl+R history search are not wired up yet.
  • whaleIdle only applies during the welcome phase — the whale freezes after the first agent turn (clicking still pops hearts).

🙏 Credits

🚀 Upgrading

Run /update inside the TUI; or dsh plugin --profile dsh-tui add @deepseek-harness-tui/dsh-tui@latest; if you launch the global dsh-tui command, also run npm install -g --legacy-peer-deps @deepseek-harness-tui/dsh-tui@latest.

Don't miss a new dsh-TUI release

NewReleases is sending notifications on new releases.