Skip to content

修正Windows下copy-path和open-terminal两个系统命令对文件资源管理器的判断异常#517

Merged
lzx8589561 merged 3 commits into
ZToolsCenter:mainfrom
Flinglin:fix-explorer-show-always
Jun 3, 2026
Merged

修正Windows下copy-path和open-terminal两个系统命令对文件资源管理器的判断异常#517
lzx8589561 merged 3 commits into
ZToolsCenter:mainfrom
Flinglin:fix-explorer-show-always

Conversation

@Flinglin

Copy link
Copy Markdown
Contributor

增加了对windows下文件资源管理器的类名判断,只有在类名为"CabinetWClass"时,才会显示copy-path和open-terminal命令。类似于下图中的界面成为前台窗口时,才显示这两个命令。
image

目前2.5.0版本,在点击系统托盘后,任务栏会成为前台窗口,此时以无法获取到打开的文件资源管理器中的路径。
同时还阻止了任务栏会成为前台窗口时,不再触发窗口激活事件,以此作为第二重保障

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces window class name (className) matching for window commands, specifically adding support for Windows Explorer (CabinetWClass) and Finder ("") to "Copy Path" and "Open in Terminal" commands. It also prevents window state switching when the Windows taskbar (Shell_TrayWnd) is focused. The review feedback points out a bug on macOS where windowInfo.className is undefined, causing the Finder.app match to fail against the empty string "" in plugin.json. A suggestion is provided to normalize windowInfo.className to an empty string during comparison.

Comment thread src/renderer/src/stores/commandDataStore.ts
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
@lzx8589561 lzx8589561 merged commit bee335e into ZToolsCenter:main Jun 3, 2026
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.

2 participants