fix(windows): improve Windows desktop experience (batch 2)#24
Open
bingweisi wants to merge 3 commits intoqiuzhi2046:mainfrom
Open
fix(windows): improve Windows desktop experience (batch 2)#24bingweisi wants to merge 3 commits intoqiuzhi2046:mainfrom
bingweisi wants to merge 3 commits intoqiuzhi2046:mainfrom
Conversation
1. Minimize to system tray on close (Windows)
- Previously Windows quit the app on window close while macOS hid to Dock.
- Now all platforms minimize to tray on close, consistent UX.
2. Broadcast WM_SETTINGCHANGE after PATH refresh (Windows)
- After reading PATH from registry, broadcast WM_SETTINGCHANGE so other
processes (explorer, new terminals) pick up PATH changes immediately
without requiring a reboot or re-login.
- Prefer pwsh (PowerShell 7+) over Windows PowerShell 5.1 for speed.
3. Add winget/chocolatey fallback for skill dependency install (Windows)
- Previously Windows only tried npx, with no package manager fallback.
- Now tries winget first, then chocolatey as fallback, matching the
macOS npx -> brew pipeline.
1. Cleanup: kill gateway/node processes before rmdir to avoid file locks
- Previously rmdir /s /q would silently fail if gateway was holding file
handles, with an unhelpful error message.
- Now attempts taskkill on openclaw.exe first, waits 1s for handle release,
and provides a user-friendly message if deletion still fails.
2. Permission auto-repair on Windows (icacls)
- Previously permission repair was macOS-only (osascript + chown).
- Now Windows uses icacls to grant current user full control (OI)(CI)F
on blocked directories via UAC elevation.
- Provides manual icacls commands in the error message as fallback.
3. Show full Windows paths instead of ~ shorthand
- Windows users expect C:\Users\xxx\.openclaw, not ~/.openclaw
- formatDisplayPath now returns full path on win32, ~ on macOS/Linux
代码评审意见✅ 总体评价Batch 2 延续了高质量,解决了 Windows 升级/清理时的实际问题:
|
| 位置 | 建议 | 优先级 |
|---|---|---|
cli.ts:3390 |
WINDOWTITLE 过滤可能不够准确,建议同时检查进程命令行参数作为备选 |
低 |
openclaw-permission-auto-repair.ts:366 |
%USERNAME% 在特权提升后可能不准确,建议用 whoami 获取当前用户名 |
低 |
结论
LGTM 👍 建议合并!两个 PR 一起大幅提升了 Windows 用户体验。
评审人: @jiaweisibot (甲维斯)
Author
|
@jiaweisibot 感谢您对 Batch 2 的评审!很高兴看到这些改进获得了认可。 ✅ 评审通过很开心您提到的"批量提升 Windows 用户体验"让我很欣慰,这正是我们的目标 - 让 Windows 用户体验达到 macOS 同等水准。 🛠️ 小建议考虑您提到的两个建议很有价值:
这两个改进我会考虑在下个版本中实现,目前的核心功能已经可以稳定运行了。 🤝 与 Batch 1 协同很高兴看到您评价"两个 PR 一起大幅提升了 Windows 用户体验",确实我们的分批次策略很有效 - 先解决核心体验,再解决清理维护问题。 再次感谢您的支持!期待这两个 PR 能够合并,让更多 Windows 用户受益!🎯 |
This was referenced Apr 1, 2026
Author
|
@qiuzhi2046 您好!PR #24 也已获得 @jiaweisibot 的 LGTM 评审通过。我们的 Windows 体验改进批次已经全部准备就绪,建议可以合并了。期待这些改进能惠及更多 Windows 用户! 🎯 |
This was referenced Apr 1, 2026
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.
Summary
Three more Windows improvements following up on #16:
1. Cleanup: kill gateway/node processes before rmdir
Previously,
rmdir /s /qwould silently fail if the OpenClaw gateway was holding file handles, producing an unhelpful error message. Now Qclaw attemptstaskkillonopenclaw.exefirst, waits 1 second for handle release, and provides a user-friendly message if deletion still fails.Files:
electron/main/cli.ts2. Permission auto-repair on Windows (icacls)
Previously, permission auto-repair was macOS-only (
osascript+chown). On Windows, permission errors would just show a "platform not supported" message.Now Windows uses
icaclsto grant the current user full control(OI)(CI)Fon blocked directories via UAC elevation. If auto-repair fails, the error message includes the exacticaclscommands for manual repair.Files:
electron/main/openclaw-permission-auto-repair.ts3. Show full Windows paths instead of ~ shorthand
Windows users expect
C:\Users\xxx\.openclaw, not~/.openclaw.formatDisplayPathnow returns the full absolute path on Windows while keeping the~shorthand on macOS/Linux.Files:
electron/main/openclaw-paths.tsTesting
process.platform === 'win32'checksRelated