Code health: consider splitting Pane class into leaf and parent classes #4536

Open
opened 2026-01-30 23:49:54 +00:00 by claunia · 4 comments
Owner

Originally created by @mcpiroman on GitHub (Oct 18, 2019).

Idea: Split Pane class into LeafPane and ParentPane, both inheriting from abstract base Pane.

Currently Pane class has many members that are used only in leaf or only in parent mode. IMHO proposed splitting would make the code much cleaner and safer (e.g. from accidentally accessing a terminal when we're not a leaf). There is a long way ahead of panes so this might be worthwhile.

Originally created by @mcpiroman on GitHub (Oct 18, 2019). Idea: Split `Pane` class into `LeafPane` and `ParentPane`, both inheriting from abstract base `Pane`. Currently Pane class has many members that are used only in leaf or only in parent mode. IMHO proposed splitting would make the code much cleaner and safer (e.g. from accidentally accessing a terminal when we're not a leaf). There is a long way ahead of panes so this might be worthwhile.
claunia added the Issue-TaskProduct-TerminalArea-UserInterfaceArea-CodeHealth labels 2026-01-30 23:49:54 +00:00
Author
Owner

@DHowett-MSFT commented on GitHub (Oct 21, 2019):

This one really needs @zadjii-msft's input. Thanks!

@DHowett-MSFT commented on GitHub (Oct 21, 2019): This one really needs @zadjii-msft's input. Thanks!
Author
Owner

@zadjii-msft commented on GitHub (Oct 25, 2019):

This seems to make sense to me. I can't think of a good reason why we wouldn't want it to be that way TBH.

@zadjii-msft commented on GitHub (Oct 25, 2019): This seems to make sense to me. I can't think of a good reason why we _wouldn't_ want it to be that way TBH.
Author
Owner

@mcpiroman commented on GitHub (Oct 25, 2019):

And to support non-terminal panes (#997), maybe also make LeafPane abstract and then inherit from it in TerminalPane and alike. What do you think?

@mcpiroman commented on GitHub (Oct 25, 2019): And to support non-terminal panes (#997), maybe also make LeafPane abstract and then inherit from it in TerminalPane and alike. What do you think?
Author
Owner

@zadjii-msft commented on GitHub (Oct 25, 2019):

So as far as #997 is concerned, I actually prototyped a bunch of that back in July, but never got it polished enough to release. YOu can see where I was going with it in this branch:
https://github.com/microsoft/terminal/compare/dev/migrie/f/non-terminal-panes

There's a good chance that reafactoring into parent/leaf panes would make this process even easier, but I was considering just adding an entire other abstraction layer between the Pane and the content anyways.

@zadjii-msft commented on GitHub (Oct 25, 2019): So as far as #997 is concerned, I actually prototyped a bunch of that back in July, but never got it polished enough to release. YOu can see where I was going with it in this branch: https://github.com/microsoft/terminal/compare/dev/migrie/f/non-terminal-panes There's a good chance that reafactoring into parent/leaf panes would make this process even easier, but I was considering just adding an entire other abstraction layer between the Pane and the content anyways.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#4536