fix(linux): correct CLI arg parsing for negative numbers and platform-gated options#7
Merged
HazAT merged 1 commit intoHazAT:mainfrom Mar 20, 2026
Merged
Conversation
…-gated options - Use --arg=value syntax for x, y, and cursor-offset args to handle negative numbers correctly with clap (e.g., --cursor-offset-y=-20 instead of --cursor-offset-y -20 which clap interprets as a flag) - Gate --open-links and --open-links-app to macOS only (with 'override' exception for mock binary testing). These flags are not implemented in the Linux/Windows binaries and were causing startup failures. - Add skip guard in test-status-item.mjs for non-macOS platforms since statusItem() is a macOS-only feature. - Include Cargo.lock for the Linux Rust binary to ensure reproducible builds.
HazAT
added a commit
that referenced
this pull request
Mar 20, 2026
Add changelog entry for the two community contributions in this release: - PR #8 (@hjanuschka): Chromium CDP backend for Linux — a zero-compile alternative to WebKitGTK that auto-falls back to system Chromium via remote-debugging-pipe. Adds follow-cursor on X11, system tray support, and external link opening on Linux. - PR #7 (@Whamp): Linux CLI fixes for negative number arg parsing and platform-gated options that caused startup failures. Update README to document the Chromium CDP backend: platform table, build instructions (Option A native / Option B zero-compile), expanded platform notes matrix splitting Linux native vs Chromium columns, GLIMPSE_BACKEND env var, and architecture listing.
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
Fixes two issues preventing Glimpse from running correctly on Linux:
Negative number CLI args — The Rust binary uses clap for argument parsing. Arguments like
--cursor-offset-y -20were being parsed as a flag-20instead of a value. Changed to--cursor-offset-y=-20syntax.Platform-gated options —
--open-linksand--open-links-appwere being passed on Linux but only implemented for macOS, causing the binary to fail with "unexpected argument" errors.Changes
src/glimpse.mjs— Use--arg=valuesyntax for--x,--y,--cursor-offset-x,--cursor-offset-yto handle negative numbers correctly with clapsrc/glimpse.mjs— Gate--open-links/--open-links-appto macOS only (allowoverrideplatform for mock binary testing)test/test-status-item.mjs— Skip test on non-macOS platforms sincestatusItem()is macOS-onlysrc/linux/Cargo.lock— Add lockfile for reproducible Linux buildsTesting
Tested on Arch Linux (Omarchy) with Hyprland:
followCursorworks on Hyprland (useshyprctl cursorpos)prompt()dialogs work