Skip to content

Windows: background update check spawns visible console windows every 10 minutes #19

Description

@halr9000

On Windows, several console windows flash open and close on their own, roughly every 10 minutes, with no user interaction.

+++ As it happens so frequently, and as the windows are gone so quickly that the user is unable to determine the cause, I would treat this as a high priority issue.

Cause: software_update_watcher() (token_meter/app.py:1575) runs as a daemon thread started from main() (token_meter/app.py:7883) and calls check_for_software_update() every UPDATE_CHECK_INTERVAL_S (600 seconds, token_meter/app.py:259). Each call runs up to six git subprocesses in sequence via _run_update_git() (token_meter/app.py:1375): rev-parse (upstream), fetch, rev-parse HEAD, rev-parse @{upstream}, rev-list --count, status --porcelain.

_run_update_git() calls subprocess.run(["git", ...]) with no window-hiding options. On Windows, each git.exe invocation opens its own console window. Other Windows process spawns in this codebase already avoid that: start_software_update() launches its helper through WindowsPlatformServices.process_options() (token_meter/platforms/windows.py:62), which sets creationflags=CREATE_NO_WINDOW. _run_update_git() doesn't go through that path.

Fix direction: route _run_update_git()'s subprocess calls through the same CREATE_NO_WINDOW mechanism on Windows.

Environment

  • Windows 11 Pro, build 10.0.26200
  • Token Meter revision 0361558 (main, 2026-08-14)
  • Bundled Python 3.12

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions