Repository navigation
Releases: liu19666/dsh-screenshot
Release list
v2.1.4 - helper lingers 30s after a capture
2.1.4
- The helper now outlives its session by 30 seconds instead of leaving immediately.
Nothing is spawned at page load; the first click starts it, and the host kills it 30s after
the session ends (detected from the native state file, so confirm / cancel / right-click all
count). A second capture inside that window reuses the warm helper over the wake-up pipe, so
it comes up instantly instead of paying the ~0.3s cold start. A session that never reports is
capped at 15 minutes. - Unchanged: the helper runs from
%LOCALAPPDATA%\dsh-screenshot\<sha256-8>\SnipTool.exe, never
node_modules(the EPERM fix from 2.1.2), so a running helper can never block a package
manager.bin/SnipTool.exebytes are identical to 2.1.1-2.1.3. - Restart DSH after installing: the host half is loaded at startup.
v2.1.3 — one process per capture, nothing running in the background
One helper process per capture. Nothing of this plugin runs between captures.
- Removed the warm-process model from the host half: no
--servechild, no named pipe, no 45s keep-alive, no 180s idle window. - A helper process is now spawned when you click the scissors button and exits as soon as the session ends (confirm, cancel or right-click).
- Cost: ~0.3-0.5s of startup per capture instead of an instant resume.
- A second click while an overlay is already open is absorbed by the native single-instance mutex.
- The helper still runs from
%LOCALAPPDATA%\dsh-screenshot\<sha256-8>\SnipTool.exe, sonode_modulesis never held open by a running process (package updates no longer hit EPERM). bin/SnipTool.exebytes are unchanged from 2.1.1/2.1.2 (d23a06e8...).
Install: pwsh -File install.ps1 -Force, then restart DSH.
v2.1.2 — 助手移出 node_modules,按需启动(修复装插件 EPERM)
修复:装其它插件时报 EPERM、整个安装被回滚
根因:截图助手 SnipTool.exe 一直从 node_modules/dsh-screenshot/bin/SnipTool.exe 运行,Windows 会锁住正在运行的映像文件;任何要重新导入这个包的 pnpm 事务都会失败(EPERM)并整体回滚——所以表现为「装什么都装不进去、连已安装的记录也没有」。重启无用:DSH 启动 300ms 内就把助手拉起来,45 秒保活一次。
改动
- 助手改为从
%LOCALAPPDATA%\dsh-screenshot\<sha256前8位>\SnipTool.exe运行。bin/SnipTool.exe只是源文件:首次截图时复制出去再执行,node_modules里的那份从此不会被任何进程占用。旧版本副本在下一次截图时顺手清理(仍在运行的会跳过)。复制失败时回退到原路径,不影响截图。 - 取消 300ms 自动启动与 45 秒保活。加载插件后不启动任何进程;第一次点剪刀才启动,之后由命名管道复用,空闲 180 秒自行退出。代价是空闲后第一次截图多约 0.3 秒。
- 文档(README / README.en / VERIFY)与 package.json 描述同步更新,去掉过期的「常驻暖进程」与「长截图」表述。
升级:host 半边在 DSH 启动时加载,需重启 DSH 生效。
未变:bin/SnipTool.exe 字节未改(sha256 d23a06e8…),座标/选区/编辑/马赛克等行为完全不变;本版本只动 host 半边的进程管理。
v2.1.1 — 修复截图完成后 DSH 变窗口化
修复:截图完成后 DSH 变窗口化
点绿勾完成截图后,DSH 会从最大化退回窗口化;右键退出则不会。
根因:完成路径把 DSH 窗口恢复了两次(粘贴前一次、关闭时一次),而 SW_RESTORE 对已经恢复的窗口会把最大化退回普通尺寸。右键退出只恢复一次,所以取消路径没有这个问题。
修法:隐藏前用 IsZoomed() 记住原状态,三处恢复点统一走 RestoreDsh(),只恢复一次并按原状态恢复(最大化 / 还原)。顺带修好左键(--no-hide)入口——它以前不隐藏窗口却也无条件 SW_RESTORE,同样会把最大化打成窗口化。
验证
| 被测 exe | --hide |
--no-hide |
|---|---|---|
| 旧版 2.1.0 | 窗口化(复现) | 窗口化 |
| 新版 2.1.1 | 保持最大化 | 保持最大化 |
真实鼠标事件驱动(非自测脚本),三次均走绿勾完成路径;EngineTests 5/5、--selftest 5/5 通过。
安装
pwsh -NoProfile -File install.ps1 -Force -Tgz dist/dsh-screenshot-2.1.1.tgz
升级后无需重启 DSH:SnipTool.exe 在每次截图时现取,改动即时生效。
完整变更:0e2d9f4
v2.1.0 — 取消长截图,入口改为左右键
v2.1.0
取消长截图功能:滚轮预览在真实页面上始终不可靠,按要求整体移除(长截图拼接、预览窗、顶部开关栏、设置文件)。
入口改为左右键
- 左键点击剪刀按钮:进入截图,保留 DSH 窗口
- 右键点击:进入截图,最小化 DSH 窗口,退出后自动恢复
- 悬停提示:
左键保留窗口,右键最小化窗口
保留的功能
- 窗口 / 屏幕 / 任务栏自动识别(蓝框 + 左上角尺寸标签 + 区域外变暗),也支持按住拖动手动框选
- 标注:矩形、椭圆、直线、箭头、画笔、文本(颜色与粗细可调);马赛克
- 底部纯图标工具栏:保存 / 取消(红叉)/ 确定(绿勾),确定后图片进入会话输入区,不自动发送
安装包
- 附件
dsh-screenshot-2.1.0.tgz(267 KB,23 个文件) bin/SnipTool.exesha25682a0e56fa9a09c76a6db474137a861d59b07375e479b94a2c9a26b4d6b98e00e(114176 B)lib/client.jssha2563bfb13f13829cdeb3323ecba5f52d3af7a37f4e8d42609db924471d0464aea41(19497 B)
验证
build.ps1 -Tests通过;EngineTests5/5;--selftest5 条 criteria + 6 张 PNGtools/e2e.ps110/10 PASS;plugin-smoke8/8;client-contract15/15(含旧 bundle 负控)- 已安装 exe 黑盒验证:
--no-hide不最小化、--hide最小化且退出后恢复(allOk=True)