[PR #16170] Refactor Pane to be able to host non-terminal content #30850

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

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

State: closed
Merged: Yes


Instead of Pane hosting a TermControl directly, it now hosts an IPaneContent. This is an abstraction between the TermControl and the pane itself, to allow for arbitrary implementations of IPaneContent, with things that might not be terminals.

References and Relevant Issues

Detailed Description of the Pull Request / Additional comments

This PR by itself doesn't do much. It's just a refactoring.

  • It doesn't actually add any other types of pane content.
  • It overall just tries to move code whenever possible, with as little refactoring as possible. There are some patterns from before that don't super scale well to other types of pane content (think: the xyzChanged events on IPaneContent).
  • There's a few remaining places where Pane is explicitly checking if its content is a terminal. We probably shouldn't, but meh

There are two follow-up PRs to this PR:

In addition, there's more work to be done after these merge:

  • TODO! issue number for "Replace IPaneContent::xyzChanged with PropertyChanged events"
  • TODO! issue number for "Re-write state restoration so panes don't produce NewTerminalArgs"

Validation Steps Performed

  • It still launches
  • It still works
  • Broadcasting still works
  • The weird restart connection thing from #16001 still works

PR Checklist

other PRs

**Original Pull Request:** https://github.com/microsoft/terminal/pull/16170 **State:** closed **Merged:** Yes --- Instead of `Pane` hosting a `TermControl` directly, it now hosts an `IPaneContent`. This is an abstraction between the TermControl and the pane itself, to allow for arbitrary implementations of `IPaneContent`, with things that might not be terminals. ## References and Relevant Issues * #997 * #1000 ## Detailed Description of the Pull Request / Additional comments This PR by itself doesn't do much. It's just a refactoring. - It doesn't actually add any other types of pane content. - It overall just tries to move code whenever possible, with as little refactoring as possible. There are some patterns from before that don't super scale well to other types of pane content (think: the `xyzChanged` events on `IPaneContent`). - There's a few remaining places where Pane is explicitly checking if its content is a terminal. We probably shouldn't, but meh There are two follow-up PRs to this PR: * #16171 * #16172 In addition, there's more work to be done after these merge: * TODO! issue number for "Replace `IPaneContent::xyzChanged` with `PropertyChanged` events" * TODO! issue number for "Re-write state restoration so panes don't produce `NewTerminalArgs`" ## Validation Steps Performed * It still launches * It still works * Broadcasting still works * The weird restart connection thing from #16001 still works ## PR Checklist - [x] Closes #997 ## other PRs * #16170 <-- you are here * #16171 * #16172
claunia added the pull-request label 2026-01-31 09:43:21 +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#30850