terminal
terminal copied to clipboard
Fix window count going out of sync when headless
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
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
--headlessflag 50+ times and confirmed_windowCountremains 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