Repository navigation
Conversation
- LeftOpen.Core: TCP listeners via GetExtendedTcpTable, process facts via WMI, working directories via PEB reads, project marker walk-up with rejection rules, ownership inference with confidence and reasons, and a three-stage gentle close (plan -> verify PID identity -> signal and poll) - LeftOpen.Tray: WinForms tray app with a door icon and an on-demand popup panel (scan on open, grouped rows, two-step close confirmation) - LeftOpen.Cli: leftopen list / <port> / open / close / --json - Gentle close ladder on Windows: WM_CLOSE -> console Ctrl+C -> Ctrl+Break, with a self-protecting ctrl handler; never force-kills - 56 unit tests
- Tray icon mirrors the original MenuBarExtra label: DoorMark (ported 1:1 from MenuPanel.swift path data) plus the closable-port count, with closed/open/error states and taskbar theme adaptation; error glyph from Segoe MDL2 Assets (SF Symbols' Windows counterpart) - exe icon: multi-size .ico generated from the original repo artwork (windows/Scripts/make-icon.ps1) - Per-row icons follow the original ProcessIconView tier chain: app exe icon (skipped for shared runtimes) -> project-shipped icon (Tauri/Next.js/public conventions + index.html-declared favicon) -> live favicon from the running server -> runtime symbol with the original's colouring -> category symbol - Row layout: icon and owner on one line, port+command+pid subline, full project names without truncation, panel widened to 480px - Panel no longer hides when Windows refuses the focus change (flash-and-vanish bug); anchors to the taskbar's screen; tray click toggles; --snapshot renders the panel (and tray states) to PNG for deterministic verification, like the original's snapshot-panel - publish.ps1: fix repo-root resolution and project paths after the windows/ move; default output windows/dist
|
Hi,我之前在抖音联系过您,借鉴您的创意,我做了一个 Windows 移植版,如果方向 OK 我可以继续维护,也欢迎提需求 |
|
谢谢你做 Windows 移植,也谢谢你愿意继续维护!这个方向很欢迎 😊 想先一起把 Windows 预览版发布出来。方便的话,可以帮忙补上 Windows 的 CI 测试和自动打包,提供解压后就能运行、不需要用户额外安装 .NET 的版本吗?希望尽量降低用户的使用门槛。再次感谢! |
|
Windows close safety review of head Confirmed by code review and Microsoft API documentation: after Minimal fail-closed patch prepared: commit 4fc88a9, on fix/windows-console-close-safety, directly based on this PR's head. The GitHub integration cannot write to the contributor fork (403), so the source branch of PR #2 has NOT been changed. Please cherry-pick this commit into Changes:
Validation status — not a Windows pass: this environment is Linux and has no .NET SDK. Before merging/releasing, please run on real Windows + .NET 8 SDK from dotnet test LeftOpen.sln
dotnet run --project tests/LeftOpen.ConsoleSafety.Probe
dotnet build LeftOpen.slnPlease retain the output and verify tray/CLI refusal messages, confirmation/cancellation, and the target-owned WM_CLOSE path. The PR's current description of Ctrl+C/Ctrl+Break and prior “no collateral damage” E2E claim also needs updating to reflect this restriction and the actual new test results. CI/self-contained packaging work already discussed remains yours; this review does not reassign it. No merge or preview release was performed. |
… packaging - .github/workflows/windows-ci.yml: on windows/** changes build Release, run the 60 unit tests, run the console-safety probe, then package the self-contained shared-runtime zip (LeftOpen-windows-x64.zip, ~67 MB, unzip and run, no .NET install) and upload it as an artifact; tags windows-v* attach it to a GitHub release - publish.ps1: -Shared mode produces the same release layout CI uses - README: document the CI and the release packaging
Running the reviewer's probe on real Windows (first execution anywhere; it was authored in a Linux environment without .NET) showed phase C asserted the opposite of observed behaviour: - GenerateConsoleCtrlEvent(CTRL_C_EVENT, group) does not fail and delivers to the group root AND its descendant (marker files prove it), while a console-mate outside the group is spared. The probe now asserts this observed delivery pattern instead of "no events". - The safety conclusion is unchanged and stronger: a group includes descendant processes LeftOpen did not create, so production correctly refuses every console control event. Also report probe failures on stdout: after FreeConsole/AllocConsole the original stderr handle is dead and .NET silently drops Console.Error writes, which made CI failures undiagnosable. Probe output now: four PASS phases, exit 0, on Win10 19045 and on the windows-latest CI runner.
|
Windows verification of the safety patch — real Windows 10 19045 + .NET 8 SDK: Cherry-picked 4fc88a9 as fa2c40a, then ran the requested checks:
One empirical correction to the probe (please review 00baeb6): this was the first execution of the probe anywhere — it was authored on Linux without .NET. On real Windows, phase C asserted the opposite of observed behaviour: Maintainer's requested items, also done (b035d91):
PR description updated to reflect the WM_CLOSE-only safety boundary. Happy to iterate further. |
What
A Windows port of LeftOpen — a system-tray app plus a
leftopenCLI sharing one C# engine — inwindows/. The macOS sources are untouched.How the platform maps
lsof -iTCP -sTCP:LISTENGetExtendedTcpTable(iphlpapi, same data netstat uses)ps -axo pid,ppid,commlsof -d cwdRTL_USER_PROCESS_PARAMETERS.CurrentDirectory).appbundlesFaithful to the original
DoorMark) plus the closable-port count, with closed / open / error states and taskbar light/dark adaptation;ProcessIconViewtier chain: app exe icon (skipped for shared runtimes) -> project-shipped icon (Tauri / Next.js /public/staticconventions, plus theindex.html-declared favicon) -> live favicon from the running server -> runtime symbol with the original colouring -> category symbol;windows/Scripts/make-icon.ps1).--snapshotrenders the panel and tray states to PNG, likesnapshot-panel.sh.leftopen [port] / open / close / --json / --dry-run).Honest deviations
http.syslisteners (e.g. .NETHttpListener) appear as PID 4 (SYSTEM) and are therefore not closable — that is Windows, not a misclassification..icns/.svgproject icons cannot be decoded on Windows; Tier 2b (npm global package icons) is not implemented yet.Testing
.github/workflows/windows-ci.ymlruns on everywindows/change: Release build → unit tests → console-safety probe →LeftOpen-windows-x64.zip(~67 MB, self-contained shared-runtime folder — unzip and run, no .NET install) uploaded as an artifact;windows-v*tags attach it to a GitHub Release.中文说明:这是 LeftOpen 的 Windows 移植版,位于
windows/目录,macOS 源码未做任何改动。托盘应用的图标体系(DoorMark + 可关闭端口数、行内四层图标链)、三段式温和关闭、归属推断的可解释性都与原版一一对应;56 个单元测试 + 真实 dev server 的端到端验证。