Skip to content

feat(terminal): 支持终端粘贴附件#295

Open
lizhian wants to merge 1 commit into
hanshuaikang:mainfrom
lizhian:own/paste-attachment
Open

feat(terminal): 支持终端粘贴附件#295
lizhian wants to merge 1 commit into
hanshuaikang:mainfrom
lizhian:own/paste-attachment

Conversation

@lizhian

@lizhian lizhian commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

变更内容

  • 为运行中任务终端和嵌入式 Shell 终端添加 macOS 下 Cmd + V 粘贴图片/文件的能力。
  • 新增终端附件粘贴设置,可控制是否启用、单个附件大小上限和任务附件数量上限。
  • 新增 Tauri 后端保存命令,将粘贴文件写入项目 .nezha/attachments/<taskId>/ 并向终端输入附件 Markdown 引用。
  • 对附件文件名、任务目录名、项目路径和附件数量/大小做基础校验与归一化,并在 Shell 终端关闭时清理对应附件目录。

影响

该能力只在 macOS 可用;非 macOS 平台保持无操作。用户可以直接把剪贴板中的图片或文件粘贴到终端,让智能体通过生成的本地文件路径读取附件。

验证

  • pnpm lint
  • pnpm test
  • pnpm build
  • cargo check

构建通过,Vite 仍输出现有的 chunk size warning。

@lizhian
lizhian marked this pull request as ready for review June 15, 2026 08:25
@lizhian
lizhian force-pushed the own/paste-attachment branch 3 times, most recently from 3f5771a to 07b7cbd Compare July 1, 2026 13:52
Allow task and shell terminals to accept pasted file attachments and pass saved paths into the terminal session with configurable safety limits.

Implementation:
- Persist terminal paste payloads in the backend with filename sanitization, count and size limits, and PTY input wiring.
- Share frontend paste handling across task and shell terminals so pasted files become readable attachment paths.
- Expose attachment limits in app settings with localized labels and supporting styles.
@lizhian
lizhian force-pushed the own/paste-attachment branch from 07b7cbd to c78fc32 Compare July 10, 2026 08:37
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.

1 participant