终端粘贴截图:写成文件并把路径打进输入行

本地终端和已保存主机的远程终端里,剪贴板只有图、没有文字时,⌘V / Ctrl+Shift+V 或右键粘贴不再丢掉图片。图存成 PNG 等文件后,把路径当作文字粘进输入行,给终端里的 Agent 读。

本地写到系统临时目录 shellrs-pastes/(目录 0700、文件 0600),超过 20 个或超过 7 天的旧文件会清掉。已保存的主机另开一条 SFTP 把文件写到远端 /tmp/shellrs-paste-….png,连上后再粘路径;登录要问答就直接失败,不弹框。超过 8 MB 拒绝。外部连接和临时连接提示不支持。剪贴板里有文字时仍粘文字。
This commit is contained in:
okooo committed 2026-10-13 02:26:58 +08:00
1 parent fd4d37946b
commit 81aeb37aee
15 files changed
+685 -23

No files matched your search

+1
View File
@@ -30,6 +30,7 @@ on:
- "src/settings/settings_panel.rs"
- "src/terminal/local_shell.rs"
- "src/app/shortcuts.rs"
- "src/terminal/paste_image.rs"
- "src/workspace/window_state.rs"
- "src/testing.rs"
- "tests/cli_bin.rs"