terminal icon indicating copy to clipboard operation
terminal copied to clipboard

Fix window count going out of sync when headless

Open lhecker opened this issue 1 year ago • 1 comments

In headless mode, WM_CLOSE_TERMINAL_WINDOW would still decrement _windowCount. While the count technically doesn't matter, it going out of sync with the actual count felt wrong.

Validation Steps Performed

  • TBD

lhecker avatar Aug 29 '25 14:08 lhecker

Title

Fix: Prevent window count mismatch in headless mode

Overview

This PR resolves an issue where _windowCount was out of sync when running in headless mode. The value is not unnecessarily incremented, so it will maintain an accurate view of internal state.

Changes

  • Added a check to prevent incrementing count when launching in headless mode.
  • Updated related logic to maintain correct lifecycle state.
  • Cleaned up unnecessary minor comments.

Related Issue

Fixes #

Testing Performed

  • Launched application with the --headless flag 50+ times and confirmed _windowCount remains accurate.
  • Confirmed standard UI mode behaves as normal, no issues.
  • Existing features have no regressions.

Impact / Risk

Low - Change is isolated to the headless path and will not impact any potential changes to the user experience.

Checklist

  • [x] Code is inline with style standards
  • [x] No breaking changes
  • [x] Tested locally
  • [x] Ready for review

riju568 avatar Nov 15 '25 17:11 riju568