[PR #11153] [MERGED] Add the ability to interact with subtrees of panes #28448

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

📋 Pull Request Information

Original PR: https://github.com/microsoft/terminal/pull/11153
Author: @Rosefield
Created: 9/6/2021
Status: Merged
Merged: 9/28/2021
Merged by: @undefined

Base: mainHead: feature/gh10733-select-subtree-panes


📝 Commits (10+)

  • 04afd36 Add the ability to interact with subtrees of panes
  • 1a22a0b Fix directional movement if non-50% splits are used.
  • 59c1db3 Remember which terminal was previously focused when we move focus to the parent. this allows us to maintain focus on the correct terminal and also go back down the correct path with the child navigation.
  • 0c900a7 Clear content before setting the content on (un)zoom so that property change always occurs.
  • 8610cb8 Make sure the right borders get set when swapping panes, and then dont overwrite them if the two parents are related.
  • d20ce76 typo
  • 200bee1 General cleanup: fix some comments, use new convenient method.
  • 9cfee03 Dont try to do anything with the parent if there is no parent
  • 259281e Merge remote-tracking branch 'origin/main' into feature/gh10733-select-subtree-panes
  • aba116b Make more actions on parent panes distribute to their children

📊 Changes

18 files changed (+797 additions, -364 deletions)

View changed files

📝 doc/cascadia/profiles.schema.json (+5 -3)
📝 src/cascadia/LocalTests_TerminalApp/TabTests.cpp (+6 -9)
📝 src/cascadia/TerminalApp/ActionPreviewHandlers.cpp (+46 -40)
📝 src/cascadia/TerminalApp/AppActionHandlers.cpp (+41 -49)
📝 src/cascadia/TerminalApp/Pane.cpp (+491 -197)
📝 src/cascadia/TerminalApp/Pane.h (+41 -11)
📝 src/cascadia/TerminalApp/Resources/en-US/Resources.resw (+3 -0)
📝 src/cascadia/TerminalApp/TabManagement.cpp (+18 -17)
📝 src/cascadia/TerminalApp/TerminalPage.h (+21 -1)
📝 src/cascadia/TerminalApp/TerminalTab.cpp (+102 -35)
📝 src/cascadia/TerminalApp/TerminalTab.h (+1 -0)
📝 src/cascadia/TerminalControl/ControlCore.cpp (+3 -0)
📝 src/cascadia/TerminalSettingsModel/ActionArgs.cpp (+4 -0)
📝 src/cascadia/TerminalSettingsModel/ActionArgs.idl (+3 -1)
📝 src/cascadia/TerminalSettingsModel/Resources/en-US/Resources.resw (+6 -0)
📝 src/cascadia/TerminalSettingsModel/TerminalSettingsSerializationHelpers.h (+3 -1)
📝 src/cascadia/TerminalSettingsModel/defaults.json (+2 -0)
📝 src/renderer/dx/DxRenderer.cpp (+1 -0)

📄 Description

This commit adds the ability to interact with subtrees of panes.

Have you ever thought that you don't have enough regression testing to
do? Boy do I have the PR for you! This breaks all kinds of assumptions
about what is or is not focused, largely complicated by the fact that a
pane is not a proper control. I did my best to cover as many cases as I
could, but I wouldn't be surprised if there are some things broken that
I am unaware of.

Done:

  • Add parent and child movement directions to move up and down the
    tree respectively
  • When a parent pane is selected it will have borders all around it in
    addition to any borders the children have.
  • Fix focus, swap, split, zoom, toggle orientation, resize, and move to
    all handle interacting with more than one pane.
  • Similarly the actions for font size changing, closing, read-only, clearing
    buffer, and changing color scheme will distribute to all children.
  • This technically leaves control focus on the original control in the
    focused subtree because panes aren't proper controls themselves. This
    is also used to make sure we go back down the same path with the
    child movement.
  • You can zoom a parent pane, and click between different zoomed
    sub-panes and it won't unzoom you until you use moveFocus or another
    action. This wasn't explicitly programmed behavior so it is probably
    buggy (I've quashed a couple at least). It is a natural consequence of
    showing multiple terminals and allowing you to focus a terminal and a
    parent separately, since changing the active pane directly does not
    unzoom. This also means there can be a disconnect between what pane is
    zoomed and what pane is active.

Validation Steps Performed

Tested focus movement, swapping, moving panes, and zooming.

Closes #10733


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/microsoft/terminal/pull/11153 **Author:** [@Rosefield](https://github.com/Rosefield) **Created:** 9/6/2021 **Status:** ✅ Merged **Merged:** 9/28/2021 **Merged by:** [@undefined](undefined) **Base:** `main` ← **Head:** `feature/gh10733-select-subtree-panes` --- ### 📝 Commits (10+) - [`04afd36`](https://github.com/microsoft/terminal/commit/04afd36675c3b943b401defa7347814c50e091f7) Add the ability to interact with subtrees of panes - [`1a22a0b`](https://github.com/microsoft/terminal/commit/1a22a0bef79b96d77d74c43762e21ef27910d761) Fix directional movement if non-50% splits are used. - [`59c1db3`](https://github.com/microsoft/terminal/commit/59c1db3a871f11d8e4b4bdfbad95623643073866) Remember which terminal was previously focused when we move focus to the parent. this allows us to maintain focus on the correct terminal and also go back down the correct path with the child navigation. - [`0c900a7`](https://github.com/microsoft/terminal/commit/0c900a76b629047f43501b7a213f903f60f366b4) Clear content before setting the content on (un)zoom so that property change always occurs. - [`8610cb8`](https://github.com/microsoft/terminal/commit/8610cb846001ecfbe2da920f76794690113d7790) Make sure the right borders get set when swapping panes, and then dont overwrite them if the two parents are related. - [`d20ce76`](https://github.com/microsoft/terminal/commit/d20ce765fb9e3ae009446398c96f92e580165ed9) typo - [`200bee1`](https://github.com/microsoft/terminal/commit/200bee1317d61391ca5942422bea6975b9922f26) General cleanup: fix some comments, use new convenient method. - [`9cfee03`](https://github.com/microsoft/terminal/commit/9cfee0318bb298e927816af145e224eaeb2a892e) Dont try to do anything with the parent if there is no parent - [`259281e`](https://github.com/microsoft/terminal/commit/259281e06b6c10cbbc4bb271b4672c877737f1b3) Merge remote-tracking branch 'origin/main' into feature/gh10733-select-subtree-panes - [`aba116b`](https://github.com/microsoft/terminal/commit/aba116bf7241d8a8609f249737095908591c23be) Make more actions on parent panes distribute to their children ### 📊 Changes **18 files changed** (+797 additions, -364 deletions) <details> <summary>View changed files</summary> 📝 `doc/cascadia/profiles.schema.json` (+5 -3) 📝 `src/cascadia/LocalTests_TerminalApp/TabTests.cpp` (+6 -9) 📝 `src/cascadia/TerminalApp/ActionPreviewHandlers.cpp` (+46 -40) 📝 `src/cascadia/TerminalApp/AppActionHandlers.cpp` (+41 -49) 📝 `src/cascadia/TerminalApp/Pane.cpp` (+491 -197) 📝 `src/cascadia/TerminalApp/Pane.h` (+41 -11) 📝 `src/cascadia/TerminalApp/Resources/en-US/Resources.resw` (+3 -0) 📝 `src/cascadia/TerminalApp/TabManagement.cpp` (+18 -17) 📝 `src/cascadia/TerminalApp/TerminalPage.h` (+21 -1) 📝 `src/cascadia/TerminalApp/TerminalTab.cpp` (+102 -35) 📝 `src/cascadia/TerminalApp/TerminalTab.h` (+1 -0) 📝 `src/cascadia/TerminalControl/ControlCore.cpp` (+3 -0) 📝 `src/cascadia/TerminalSettingsModel/ActionArgs.cpp` (+4 -0) 📝 `src/cascadia/TerminalSettingsModel/ActionArgs.idl` (+3 -1) 📝 `src/cascadia/TerminalSettingsModel/Resources/en-US/Resources.resw` (+6 -0) 📝 `src/cascadia/TerminalSettingsModel/TerminalSettingsSerializationHelpers.h` (+3 -1) 📝 `src/cascadia/TerminalSettingsModel/defaults.json` (+2 -0) 📝 `src/renderer/dx/DxRenderer.cpp` (+1 -0) </details> ### 📄 Description This commit adds the ability to interact with subtrees of panes. Have you ever thought that you don't have enough regression testing to do? Boy do I have the PR for you! This breaks all kinds of assumptions about what is or is not focused, largely complicated by the fact that a pane is not a proper control. I did my best to cover as many cases as I could, but I wouldn't be surprised if there are some things broken that I am unaware of. Done: - Add `parent` and `child` movement directions to move up and down the tree respectively - When a parent pane is selected it will have borders all around it in addition to any borders the children have. - Fix focus, swap, split, zoom, toggle orientation, resize, and move to all handle interacting with more than one pane. - Similarly the actions for font size changing, closing, read-only, clearing buffer, and changing color scheme will distribute to all children. - This technically leaves control focus on the original control in the focused subtree because panes aren't proper controls themselves. This is also used to make sure we go back down the same path with the `child` movement. - You can zoom a parent pane, and click between different zoomed sub-panes and it won't unzoom you until you use moveFocus or another action. This wasn't explicitly programmed behavior so it is probably buggy (I've quashed a couple at least). It is a natural consequence of showing multiple terminals and allowing you to focus a terminal and a parent separately, since changing the active pane directly does not unzoom. This also means there can be a disconnect between what pane is zoomed and what pane is active. ## Validation Steps Performed Tested focus movement, swapping, moving panes, and zooming. Closes #10733 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
claunia added the pull-request label 2026-01-31 09:28: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#28448