[PR #14421] Refactor ConsoleProcessList #30089

Open
opened 2026-01-31 09:38:35 +00:00 by claunia · 0 comments
Owner

Original Pull Request: https://github.com/microsoft/terminal/pull/14421

State: closed
Merged: Yes


This commit is just a slight refactor of ConsoleProcessList which I've noticed
was in a poor shape. It replaces iterators with for-range loops, etc.

Additionally this fixes a bug in SetConsoleWindowOwner, where it used to
default to the newest client process instead of the oldest.

Finally, it changes the process container type from a doubly linked list
over to a simple array/vector, because using linked lists for heap allocated
elements felt quite a bit silly. To preserve the previous behavior of
GetProcessList, it simply iterates through the vector backwards.

Validation Steps Performed

  • All unit/feature tests pass
  • Launching a TUI application inside pwsh inside cmd
    and exiting kills all 3 applications
**Original Pull Request:** https://github.com/microsoft/terminal/pull/14421 **State:** closed **Merged:** Yes --- This commit is just a slight refactor of `ConsoleProcessList` which I've noticed was in a poor shape. It replaces iterators with for-range loops, etc. Additionally this fixes a bug in `SetConsoleWindowOwner`, where it used to default to the newest client process instead of the oldest. Finally, it changes the process container type from a doubly linked list over to a simple array/vector, because using linked lists for heap allocated elements felt quite a bit silly. To preserve the previous behavior of `GetProcessList`, it simply iterates through the vector backwards. ## Validation Steps Performed * All unit/feature tests pass ✅ * Launching a TUI application inside pwsh inside cmd and exiting kills all 3 applications ✅
claunia added the pull-request label 2026-01-31 09:38:35 +00:00
Sign in to join this conversation.
No Label pull-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#30089