-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Description
Add an optional CLI flag to skip the automatic display clear that happens after each capture run, useful for debugging and batch capture scenarios.
Work Required
- Add CLI Flag: Add
--no-clearor--skip-clearflag to capture commands - Modify Capture Logic: Update
capture/capture.jsto conditionally skip clear - Update Help Text: Document new flag in CLI help and README
- Test Functionality: Verify flag works correctly without side effects
Implementation Details
Based on capture/capture.js, the current behavior:
Current Clear Process
// In captureTemplate() finally block
try {
await this.clearDisplay(null);
} catch (e) {
this.debug(`Post-capture clear failed: ${e.message}`);
}The clearDisplay() method:
- Uses CLI to call
hdisplay clear - Waits ~1200ms for frontend crossfade cleanup
- Ensures clean state for next capture
Proposed Changes
Add flag to both capture commands:
hdisplay capture:all --no-clearhdisplay capture:template <id> --no-clear
Pass flag to BlackBoxCapture constructor and conditionally skip clear.
Use Cases
When to Skip Clear
- Debugging: Leave content visible for inspection
- Batch Operations: Running multiple captures in sequence
- Development: Iterating on capture profiles
- Performance: Avoiding clear delay when not needed
When to Keep Clear (Default)
- Gallery Generation: Ensure clean captures
- Production Runs: Consistent starting state
- Automated Testing: Reliable capture environment
Files to Modify
cli/index.mjs- Add--no-clearflag to capture commandscapture/capture.js- Add conditional clear logic tocaptureTemplate()
Implementation Approach
CLI Changes
.option('--no-clear', 'Skip post-capture display clear')Capture Changes
constructor(options = {}) {
// ...
this.skipClear = options.skipClear || false;
}
// In captureTemplate() finally block
if (!this.skipClear) {
try {
await this.clearDisplay(null);
} catch (e) {
this.debug(`Post-capture clear failed: ${e.message}`);
}
}Testing
- Test
capture:all --no-clearleaves final template visible - Test
capture:template <id> --no-clearleaves template visible - Test default behavior (clear after capture) still works
- Verify no impact on capture quality or timing
Acceptance Criteria
- CLI flag is properly documented in help text
- Clear is skipped when flag is provided
- Default behavior (clear after capture) is preserved when flag not used
- No impact on capture functionality when flag is used
- Flag works for both
capture:allandcapture:templatecommands
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels