Skip to content

Headless runs register Stop and Emergency hotkeys after clicking has started #150

Closed

Description

@TMHSDigital

Summary

In headless mode the click thread starts before the hotkey manager is started and switched to running, so the first clicks happen with no stop keys registered.

Where

  • autoclicker/cli.py:301-314

Details

controller.validate_and_start_clicking(...) starts clicking, then hotkeys.start(bindings) registers the idle keys and waits up to 2 s for the thread, and only then set_running(True) registers Stop and Emergency.

Impact

With a start delay of 0 the advertised stop keys do not exist for the first moments of a run. Ctrl+C in the console still works.

Suggested fix

Call hotkeys.start(bindings) and set_running(True) before validate_and_start_clicking, and stop the hotkeys if the start fails.

Acceptance criteria

  • Stop and Emergency are registered before the first click in headless mode
  • A failed start unregisters the hotkeys

Getting started

  • Relevant files: autoclicker/cli.py, tests/test_cli.py
  • How to run tests: make check (Git Bash) or tasks.bat lint, tasks.bat typecheck, tasks.bat test (cmd). Single test: python -m pytest tests/test_x.py::TestClass::test_name --no-cov
  • Related docs: CONTRIBUTING.md, docs/ARCHITECTURE.md

Filed by repo-audit/full-audit at 9968dc8. Severity: low. Effort: S. audit-key: bug|autoclicker/cli.py|run_headless

Activity

  1. added
    bug
    good first issue
    priority: low
    safety
    on Nov 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    buggood first issuepriority: lowsafety

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions