microsoft / microsoft/terminal

Consider making conhost internal interfaces derive form IUnknown, be COM-like

Open
#10,388 0 comments 0 reactions 0 assignees View on GitHub
Area-CodeHealth Issue-Task Priority-3 Product-Conhost
Dominant language
C++
Stars
105k
Forks
9.6k
Avg merge
3d 17h
Merged PRs (30d)
29

Description

This would solve a bunch of our internal ownership issues in a way that's slightly better than "sometimes it has a `shared_ptr`, but the class doesn't know".

Depending on which runtimeclass implementation we use, we could also get weak references. We could also just use non-owning pointers where there would be a reference cycle.

Consider:

* `IUiaData` -- this would also help clear up ownership in Terminal between TermControl and TermControlFrameworkAutomationPeer
* `IRenderData`
* `IControlAccessibilityInfo`
* `IUiaEventDispatcher`
* `ITerminalApi` and `ITerminalInput`?
* Many of the things in interactivity- `IConsoleWindow`, `IHighDpiApi`, `IConsoleControl`, `IConsoleInputThread`, `IWindowMetrics`, etc.
* `IRenderEngine` `IRenderTarget` `IRenderThread` (let the renderer keep itself alive if necessary, fix some ownership issues with render engines and render base)

Contributor guide

Open the contributing guide

Research direction

No files, tests, or entry points are named. Start by mapping the listed interfaces, including IUiaData, IRenderData, IRenderEngine, and the interactivity interfaces, then inspect the runtimeclass implementations and current ownership patterns. The issue is complete only when a concrete, agreed scope and acceptance criteria exist for the interfaces to change.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
desktop, operating-systems
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.