Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability to select and interact with subtrees of panes #10733

Closed
Tracked by #1000
Rosefield opened this issue Jul 20, 2021 · 4 comments · Fixed by #11153
Closed
Tracked by #1000

Ability to select and interact with subtrees of panes #10733

Rosefield opened this issue Jul 20, 2021 · 4 comments · Fixed by #11153
Labels
Area-UserInterface Issues pertaining to the user interface of the Console or Terminal Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. Product-Terminal The new Windows Terminal. Resolution-Fix-Committed Fix is checked in, but it might be 3-4 weeks until a release.

Comments

@Rosefield
Copy link
Contributor

Rosefield commented Jul 20, 2021

Description of the new feature/enhancement

There are a number of features that exist or are being made that allows one to manipulate the tree of panes from the leaves, e.g. resize-pane, split-pane, move-pane, toggle-split, etc. It would be helpful if this functionality could be extended such that a user can select a particular subtree and interact with it directly.

Some examples
Suppose you have the following grids

1
---------------------
|    1    |    3    |
----------+----------
|    2    |    4    |
---------------------  

2
-----------
|    1    |
|---------|
|    2    | 
|---------|
|    3    |
|---------|
|    4    |
-----------

where the tree for each is

  /\
/\  /\
1 2 3 4

currently there is no way to:

  • For the 2nd grid to resize the split between panes 2/3 (because resize will only work on the 1/2 or 3/4 parent)
  • For either, add a split on a parent, e.g. create the tree where an existing subtree is made into the child of a new parent
  / \
/\   /\
5 /\ 3 4
 1 2
  • Once the base features are added for move-panes, swap-panes, etc, it would be nice to be able to take an entire subtree and swap it with another pane/subtree, move it to another tab, etc in one action
  • For toggle-split once it is added because there is no way to select a parent of a pane, there is no way to turn grid 1 into grid 2 because only parents of leaves can be modified.

Proposed technical implementation details (optional)

One possible solution to this would be to have a hotkey (or other mechanism) to select the parent of the currently focused pane. This parent would then itself be focused and some of the existing set of actions could be applied to it. This might require giving IDs to non-leaf panes so that they can be addressed individually.

A component of this could also be some mechanism to show the tree structure of the tab, perhaps just adding borders (in different colors?) to every pane and not just leaf panes.

@Rosefield Rosefield added the Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. label Jul 20, 2021
@ghost ghost added Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting Needs-Tag-Fix Doesn't match tag requirements labels Jul 20, 2021
@zadjii-msft
Copy link
Member

Out of curiosity, is there any sort of similar functionality in tmux? They've got one of the best pane implementations out there. It's a pretty reliable source of good prior art.

@DHowett
Copy link
Member

DHowett commented Jul 20, 2021

There is support for this in the i3 window manager, which is excellent. You can select panes or groups of panes at any level.

@Rosefield
Copy link
Contributor Author

Most of what I'm familiar with in terms of window managers is xmonad, and a lot of my thoughts on what features I want come from there. This particular request just seemed like the logical progression of functionality given what I've tried to do using this terminal since it has an explicit tree structure.

@zadjii-msft zadjii-msft added the Product-Terminal The new Windows Terminal. label Jul 21, 2021
@zadjii-msft zadjii-msft added the Area-UserInterface Issues pertaining to the user interface of the Console or Terminal label Jul 21, 2021
@ghost ghost removed the Needs-Tag-Fix Doesn't match tag requirements label Jul 21, 2021
@zadjii-msft zadjii-msft added this to the Terminal Backlog milestone Jul 21, 2021
@DHowett DHowett removed the Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting label Jul 22, 2021
@ghost ghost closed this as completed in #11153 Sep 28, 2021
@ghost ghost added the Resolution-Fix-Committed Fix is checked in, but it might be 3-4 weeks until a release. label Sep 28, 2021
ghost pushed a commit that referenced this issue Sep 28, 2021
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
@ghost
Copy link

ghost commented Oct 20, 2021

🎉This issue was addressed in #11153, which has now been successfully released as Windows Terminal Preview v1.12.2922.0.:tada:

Handy links:

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-UserInterface Issues pertaining to the user interface of the Console or Terminal Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. Product-Terminal The new Windows Terminal. Resolution-Fix-Committed Fix is checked in, but it might be 3-4 weeks until a release.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants