Skip to content

prettyscreenshot: --hide as the trailing flag drops the explicit path argument #1378

@Masashi-Ono0611

Description

@Masashi-Ono0611

Description

prettyscreenshot --hide <selector> <path> silently drops the explicit path argument when --hide is the last flag before the positional path. The screenshot lands at the default timestamped path (/tmp/browse-pretty-<timestamp>.png) instead of the path the caller passed.

The --hide parser appears to consume the next positional argument as another selector value, even when that positional is the documented output path (per prettyscreenshot [--scroll-to sel|text] [--cleanup] [--hide sel...] [--width px] [path]).

Possibly the same family as #495 (browse screenshot: relative paths starting with . are misidentified as CSS selectors), but that one was about screenshot/CSS-selector disambiguation, while this is about prettyscreenshot/--hide consuming an unrelated positional.

Reproduction matrix (gstack 1.28.0.0 on macOS 26.4.1, Bun-compiled)

B=~/.claude/skills/gstack/browse/dist/browse
$B goto https://example.com

# Case A — BROKEN: --hide <sel> <path>
$ $B prettyscreenshot --hide 'header' /tmp/case-a.png
Screenshot saved : /tmp/browse-pretty-2026-05-08T16-27-54.png   # path dropped

# Case B — WORKS: --hide <sel> --cleanup <path>
$ $B prettyscreenshot --hide 'header' --cleanup /tmp/case-b.png
Screenshot saved (cleaned) : /tmp/case-b.png                    # path honored

# Case C — BROKEN: --hide <sel1> --hide <sel2> <path>
$ $B prettyscreenshot --hide 'header' --hide 'footer' /tmp/case-c.png
Screenshot saved : /tmp/browse-pretty-...png                    # path dropped

# Case D — BROKEN: --cleanup --hide <sel> <path>
$ $B prettyscreenshot --cleanup --hide 'header' /tmp/case-d.png
Screenshot saved (cleaned) : /tmp/browse-pretty-...png          # path dropped

Pattern

The path argument is honored only when --hide is followed by another flag before the positional path. Whenever --hide is the trailing flag, the parser swallows the path as another --hide value.

Workaround

Always place another flag (e.g. --cleanup) after the last --hide before the explicit path, or rely on the auto-generated timestamped filename.

Expected behavior

prettyscreenshot --hide <sel> <path> should treat the trailing positional as [path] per the documented signature, regardless of which flag comes immediately before it.

Environment

  • gstack: 1.28.0.0
  • Platform: macOS 26.4.1 (arm64)
  • Binary: ~/.claude/skills/gstack/browse/dist/browse (Bun-compiled)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions