feat: 支持 macOS(.app 探测 / osascript 弹窗 / Cmd+A 受信全选回填) - #2
Merged
Conversation
…l 进程管理、osascript 弹窗、Cmd+A 受信全选回填,install 生成 .command 启动器,build-exe 非平台守卫,README 平台化
…焙 node 路径、后台拉起控制器即退避免 LS 常驻去激活),控制器单实例 pid 锁防双通道重复注入、重复点击聚焦已运行 ZCode+;make-icon 模块化并新增 icns 打包
Contributor
Author
|
追加:macOS 入口升级为真正的应用包。
实测(macOS + ZCode 3.11.2):双击 .app → ZCode+ 启动注入 ✓;重复点击 → 仅聚焦、进程数不变 ✓;ZCode 退出 → 控制器退出、锁释放 ✓ |
Owner
|
感谢这个高质量的 PR!Cmd+A 受信回填的真机实测特别有价值——这是之前评估中最不确定的行为点。 已合并到 master(v1.3.1),PR 基于 v1.2.4 而 master 已含 Linux 重构,所以做了如下适配,darwin 行为均保持你的原实现: 合并适配点
已验证(Windows/WSL 侧):单测 12/12、语法检查、平台审计(process.platform 仅 2 处定义)、双平台构建 1.3.1(win 32.7MB / linux 41.9MB,包内版本一致)、Windows 活体探针基线健康。 想请你帮忙做一轮真机回归:拉最新 master 后
如果发现任何 mac 侧问题,直接在这个 PR 或新 issue 里贴 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
背景
ZCode+ 此前仅支持 Windows(ZCode.exe 探测、tasklist/taskkill、PowerShell 弹窗、.lnk 快捷方式、Ctrl+A 受信全选)。本 PR 让控制器与安装器在 macOS 上原生可用,Windows 行为完全不变。
改动
controller.mjs
.app包路径(自动解析CFBundleExecutable,解析失败缺省ZCode),候选来源为 ZCode+ 所在目录逐级向上、/Applications、~/Applications、Spotlight(mdfind "kMDItemFSName == 'ZCode.app'");Windows 保持原链(盘符/标准位置/where)pgrep -x ZCode/pkill -x ZCode替代 tasklist / taskkillosascript display dialog(execFileSync数组传参,无 shell 转义;AppleScript 字符串按行拆分用linefeed连接,支持中文/引号/换行/反斜杠);统一确认语义判断messageBoxConfirmed()open -t替代 notepad_readme平台化;版本 1.2.4 → 1.3.0install.mjs
~/Library/Application Support/ZCodePlus,桌面生成可双击的ZCode+.command启动器(经 Terminal 登录 shell 启动,PATH 含 node);跳过 ico/vbs/bat/lnk 等 Windows 专属步骤build-exe.mjs
README.md
实测环境
macOS(Darwin 25.6.0)+ ZCode 3.11.2(
/Applications/ZCode.app)+ Node 25:/Applications/ZCode.app自动解析到Contents/MacOS/ZCode✅__wbEnhancebinding、控制器版本号均在位 ✅AAA→ Cmd+A + insertTextBBB→ 内容仅BBB(替换而非追加)✅~/.zcode/v2/config.json在 macOS 相同,无需改动 ✅IS_MAC分支内)备注
node install.mjs源码部署