-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Preliminary work to add Swap Panes functionality (GH Issues 1000, 4922) #10638
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay I haven't looked at Pane.cpp yet, but from a cursory glance, everything else here looks good. I'll probably come back through to actually read Pane.cpp sometime later this week.
Very excited about this!
I attempted to add some basic test cases for the move panes functionality, but getting them ran has so far eluded me.
The |
Yea, you'll definitely need to build
That's definitely not expected, what errors exactly are you seeing? I could have swore that |
Taking a look again, TestHostApp does build, and I did check that it does not depend on RemotingTests.cpp. I may have done a full solution build when I saw that problem? Regardless I just noticed the powershell Invoke-OpenConsoleTests that does seem to work for me so I'll try that out. |
VERIFY_ARE_EQUAL(4u, tab->_activePane->Id().value()); | ||
|
||
// Inspect the tree to make sure we swapped | ||
VERIFY_ARE_EQUAL(4u, tab->_rootPane->_firstChild->_secondChild->Id().value()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am having a bit of troubles with this test with (presumably) threading issues. Specifically when running the test, if I attach a debugger and step through everything works correctly, however if I just run it normally it will fail here and the pane's children are the same before and after _HandleMovePane
. (Yes I know that the IDs are incorrect here right now, I was going to wait to commit again until I figure out getting the test to pass consistently)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TBH, all these UI like tests have those sorts of issues. If it were me, I'd just split this up into more RunOnUIThread
calls, and maybe even insert some Sleep
s between 😄
I'd probably split this up.... (see above)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel dirty adding as many sleeps as I did (they may not all be necessary), but at least the test passes consistently now.
I was also seeing issues when compiling the It seems to have been fixed by #10593, so if you sync your fork the compilation issues should go away. |
6641fa5
to
1619d9d
Compare
Assuming this gets approved, I took a quick peek at doing #2398 as well, and the commit is rather simple Rosefield@b6da1ea. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, I'm cool with this. I have nits, but I wouldn't dare call any of them blocking. This is really cool stuff, excited to see the follow ups land too!
VERIFY_ARE_EQUAL(4u, tab->_activePane->Id().value()); | ||
|
||
// Inspect the tree to make sure we swapped | ||
VERIFY_ARE_EQUAL(4u, tab->_rootPane->_firstChild->_secondChild->Id().value()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TBH, all these UI like tests have those sorts of issues. If it were me, I'd just split this up into more RunOnUIThread
calls, and maybe even insert some Sleep
s between 😄
I'd probably split this up.... (see above)
- Add boilerplate/infrastructure for argument parsing, hotkeys, event handling - Adds the "MovePane" function that finds the focused pane, and then tries to find a pane that is visually adjacent to according to direction. - First pass at the "SwapPanes" function that swaps the tree location of two panes - First "working" version of helpers _FindFocusAndNeighbor and _FindNeighborFromFocus that search the tree for the currently focused pane, and then climbs back up the tree to try to find a sibling pane that is adjacent to it. The actual `_IsAdjacent' function is just a stub. Once working these functions could be utilized to also solve GH issue 2398.
- FindFocusAndNeighbor and FindNeighborFromFocus now record a relative offset of their children. - _IsAdjacent now properly tests if two panes, given eachs' relative offsets are adjacent according to direction.
…olumn locations to the correct elements.
6aa8bc9
to
4397d16
Compare
@zadjii-msft What are the next steps to getting this merged? Thanks again for all of your time for reviewing. |
At this point we need another signoff - @PankajBhojwani and @DHowett are fairly well versed in this part of the codebase, but it could be anyone on the team IMO. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not "requesting changes" because I'd like you to change anything.
Rather I'd like to simply discuss some of the points I brought up before we merge this.
[default_interface] runtimeclass MovePaneArgs : IActionArgs | ||
{ | ||
MovePaneArgs(FocusDirection direction); | ||
FocusDirection Direction { get; }; | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't believe there's a reason for us to introduce a MovePaneArgs
class, when we could also rename MoveFocusArgs
to FocusDirectionArgs
and use that class for both commands.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
imo I'd rather keep the args for various different actions all separate, even if they coincidentally end up with the same properties. I think that helps keep the usages of these classes more specifc. You don't risk accidentally adding properties to another action when modifying one. Like, if we did ever want to modify one of these two actions in the future, keeping them separate now would be easier. Especially considering the movePane(from=1, to=3)
case, where we're swapping panes by their indicies, and not just a direction
{ | ||
if (direction == FocusDirection::Previous) | ||
{ | ||
if (auto lastPane = _rootPane->FindPane(_mruPanes.at(1))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What happens if you run the command with only a single pane being visible? Wouldn't _mruPanes.at(1)
throw?
I can see that NavigateFocus
does the same, but is that actually safe?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you're probably right that this is unsafe, I can add a check to both of these functions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added a check to return early if _mruPanes.size() < 2
src/cascadia/TerminalApp/Pane.cpp
Outdated
std::vector<std::shared_ptr<Pane>> parents; | ||
parents.push_back(shared_from_this()); | ||
std::shared_ptr<Pane> firstParent = nullptr; | ||
std::shared_ptr<Pane> secondParent = nullptr; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While this algorithm is excellent I believe it's efficiency where it's not required.
Assuming a user has 1024 panes in a single tab the maximum recursion depth we'd have otherwise would be 10, which isn't particularly hard on the CPU & cache.
For instance:
std::shared_ptr<Pane> Pane::_findParentOfChild(Pane* root, const Pane* child)
{
if (root)
{
if (root->_firstChild.get() == child || root->_secondChild.get() == child)
{
return root->shared_from_this();
}
if (auto found = _findParentOfChild(root->_firstChild.get(), child))
{
return found;
}
if (auto found = _findParentOfChild(root->_secondChild.get(), child))
{
return found;
}
}
return {};
}
And then:
auto firstParent = _findParentOfChild(this, first.get());
auto secondParent = _findParentOfChild(this, second.get());
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did it this way to avoid having yet another recursive helper function, but also it is somewhat vestigial on when I captured additional state and tried to modify it in place. I can see about refactoring a bit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I created a _FindParentOfPane
function and used it to replace the the vector-based logic.
// - A tuple of Panes, the first being the focused pane if found, and the second | ||
// being the adjacent pane if it exists, and a bool that represents if the move | ||
// goes out of bounds. | ||
Pane::FocusNeighborSearch Pane::_FindFocusAndNeighbor(const FocusDirection& direction, const Pane::PanePoint offset) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we view this problem from the point of the focused pane, what this function (and the other) do is basically:
- move to the parent node
- check if the other child node - the one the focused pane doesn't belong to - is in the direction we want to move the pane to
- if yes: swap panes
- if no: continue with the parent node
Is that correct?
If my understanding is correct, I believe we can simplify this code after it has been merged.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is mostly a correct summary, yes. I do notice that my comment on this function is out of date so I'll update that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can file this as a follow up - it's not blocking this particular PR, but yea the code probably could be improved.
…anes to find parents. Add checks to make sure there are enough panes to actually find the previous one.
Hello @zadjii-msft! Because this pull request has the p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (
|
…2) (microsoft#10638) <!-- Enter a brief description/summary of your PR here. What does it fix/what does it change/how was it tested (even manually, if necessary)? --> ## Summary of the Pull Request Add functionality to swap a pane with an adjacent (Up/Down/Left/Right) neighbor. <!-- Other than the issue solved, is this relevant to any other issues/existing PRs? --> ## References This work potentially touches on: microsoft#1000 microsoft#2398 and microsoft#4922 <!-- Please review the items on the PR checklist before submitting--> ## PR Checklist * [x] Closes a component of microsoft#1000 (partially, comment), microsoft#4922 (partially, `SwapPanes` function is added but not hooked up, no detach functionality) * [x] CLA signed. If not, go over [here](https://cla.opensource.microsoft.com/microsoft/Terminal) and sign the CLA * [x] Tests added/passed * [ ] Documentation updated. If checked, please file a pull request on [our docs repo](https://github.com/MicrosoftDocs/terminal) and link it here: #xxx * [x] Schema updated. * [ ] I've discussed this with core contributors already. If not checked, I'm ready to accept this work might be rejected in favor of a different grand plan. Issue number where discussion took place: #xxx <!-- Provide a more detailed description of the PR, other things fixed or any additional comments/features here --> ## Detailed Description of the Pull Request / Additional comments Its been a while since I've written C++ code, and it is my first time working on a Windows application. I hope that I have not made too many mistakes. Work currently done: - Add boilerplate/infrastructure for argument parsing, hotkeys, event handling - Adds the `MovePane` function that finds the focused pane, and then tries to find a pane that is visually adjacent to according to direction. - First pass at the `SwapPanes` function that swaps the tree location of two panes - First working version of helpers `_FindFocusAndNeighbor` and `_FindNeighborFromFocus` that search the tree for the currently focused pane, and then climbs back up the tree to try to find a sibling pane that is adjacent to it. - An `_IsAdjacent' function that tests whether two panes, given their relative offsets, are adjacent to each other according to the direction. Next steps: - Once working these functions (`_FindFocusAndNeighbor`, etc) could be utilized to also solve microsoft#2398 by updating the `NavigateFocus` function. - Do we want default hotkeys for the new actions? <!-- Describe how you validated the behavior. Add automated tests wherever possible, but list manual validation steps taken as well --> ## Validation Steps Performed At this point, compilation and manual testing of functionality (with hotkeys) by creating panes, adding distinguishers to each pane, and then swapping them around to confirm they went to the right location.
🎉 Handy links: |
* Update to change equal symbol to plus key Addresses issue #196 *On my Surface Book keyboard + and = are the same key, but this may not be the case for all keyboard layouts. * change + to plus as shipped by default * Add notes about title change persistance * Update settings.json section * Link settings.json mentions * Fix links * fix a few more links * Update TerminalDocs/customize-settings/actions.md Co-authored-by: Kayla Cinnamon <cinnamon@microsoft.com> * Update TerminalDocs/dynamic-profiles.md Co-authored-by: Kayla Cinnamon <cinnamon@microsoft.com> * Update TerminalDocs/customize-settings/actions.md Co-authored-by: Kayla Cinnamon <cinnamon@microsoft.com> * Remove repititious section * Added browser media keys (#371) * Add link to what is command line shell video (#377) * add intenseTextStyle to the docs (#381) * Multiple new pane features (#383) Documentation for - microsoft/terminal#10713 - microsoft/terminal#10638 - microsoft/terminal#10780 - microsoft/terminal#10927 * wt.exe --window argument now available (#388) * Add notes that the `font` object is only 1.10+ (#389) Co-authored-by: Kayla Cinnamon <cinnamon@microsoft.com> * Remove MinimizeToTray action mentions (#387) * Docs updates for 1.11 release (#397) * Specify OS version availability for defterm (#417) Co-authored-by: Kayla Cinnamon <cinnamon@microsoft.com> * Remove tilde Reshttps://github.com/MicrosoftDocs/terminal/issues/260olves * Improve dup tab description #292 * Update minimizetotray setting to new name * Merge release 1.12 into master (#428) Co-authored-by: Kayla Cinnamon <cinnamon@microsoft.com> Co-authored-by: Pankaj Bhojwani <pabhojwa@microsoft.com> Co-authored-by: Matt Wojciakowski <mattwoj@microsoft.com> Co-authored-by: Mike Griese <migrie@microsoft.com> Co-authored-by: Carlos Zamora <carlos.zamora@microsoft.com> Co-authored-by: Schuyler Rosefield <Rosefield@users.noreply.github.com> Co-authored-by: PankajBhojwani <pankaj.d.bhoj@gmail.com> * Remove preview labels * Add redirect for old powerline page * Add vscode to gitignore * Config changes to reflect the default branch from master to main. * Add a note about the command palette to this doc (#447) * Add details about the command used to print the table (#446) * initialPos -> initialPosition (#445) * Add tip on extensions for configuration files (#440) * Add tip on extensions for configuration files Resolves #423 * fix numbering Co-authored-by: Matt Wojciakowski <mattwoj@microsoft.com> * Corrected path (#434) The LocalAppData path was missing `{app-name}` * Update panes.md (#432) Minor edit on a shortcut key * Correct $PROFILE configuration (#431) When using winget, Oh-my-posh will not add Set-PoshPrompt to path, the execution will fail. The correct configuration can be found in https://ohmyposh.dev/docs/windows#replace-your-existing-prompt * Add a sample page (#444) * Add FAQ page (#442) * Add FAQ page * Finalize faq v1 * Replace md with yml, add toc * Update with settings UI feedback from kayla * fix image link * Fix preview faq Co-authored-by: Kayla Cinnamon <cinnamon@microsoft.com> Co-authored-by: Floris Westerman <me@floriswesterman.nl> Co-authored-by: Mike Griese <migrie@microsoft.com> Co-authored-by: Schuyler Rosefield <Rosefield@users.noreply.github.com> Co-authored-by: Sean Jacobs <Sophismata@users.noreply.github.com> Co-authored-by: Leon Liang <lelian@microsoft.com> Co-authored-by: Carlos Zamora <carlos.zamora@microsoft.com> Co-authored-by: Pankaj Bhojwani <pabhojwa@microsoft.com> Co-authored-by: PankajBhojwani <pankaj.d.bhoj@gmail.com> Co-authored-by: Nivaldo Tokuda <ni.h1@hotmail.com> Co-authored-by: David A. Sjøen <dasjoen@gmail.com> Co-authored-by: tharindu sathischandra <34299693+tharindusathis@users.noreply.github.com> Co-authored-by: Cutano <rinne@rinne.top>
* Update to change equal symbol to plus key Addresses issue #196 *On my Surface Book keyboard + and = are the same key, but this may not be the case for all keyboard layouts. * change + to plus as shipped by default * Add notes about title change persistance * Update settings.json section * Link settings.json mentions * Fix links * fix a few more links * Update TerminalDocs/customize-settings/actions.md Co-authored-by: Kayla Cinnamon <cinnamon@microsoft.com> * Update TerminalDocs/dynamic-profiles.md Co-authored-by: Kayla Cinnamon <cinnamon@microsoft.com> * Update TerminalDocs/customize-settings/actions.md Co-authored-by: Kayla Cinnamon <cinnamon@microsoft.com> * Remove repititious section * Added browser media keys (#371) * Add link to what is command line shell video (#377) * add intenseTextStyle to the docs (#381) * Multiple new pane features (#383) Documentation for - microsoft/terminal#10713 - microsoft/terminal#10638 - microsoft/terminal#10780 - microsoft/terminal#10927 * wt.exe --window argument now available (#388) * Add notes that the `font` object is only 1.10+ (#389) Co-authored-by: Kayla Cinnamon <cinnamon@microsoft.com> * Remove MinimizeToTray action mentions (#387) * Docs updates for 1.11 release (#397) * Specify OS version availability for defterm (#417) Co-authored-by: Kayla Cinnamon <cinnamon@microsoft.com> * Remove tilde Reshttps://github.com/MicrosoftDocs/terminal/issues/260olves * Improve dup tab description #292 * Update minimizetotray setting to new name * Merge release 1.12 into master (#428) Co-authored-by: Kayla Cinnamon <cinnamon@microsoft.com> Co-authored-by: Pankaj Bhojwani <pabhojwa@microsoft.com> Co-authored-by: Matt Wojciakowski <mattwoj@microsoft.com> Co-authored-by: Mike Griese <migrie@microsoft.com> Co-authored-by: Carlos Zamora <carlos.zamora@microsoft.com> Co-authored-by: Schuyler Rosefield <Rosefield@users.noreply.github.com> Co-authored-by: PankajBhojwani <pankaj.d.bhoj@gmail.com> * Remove preview labels * Add redirect for old powerline page * Add vscode to gitignore * Config changes to reflect the default branch from master to main. * Add a note about the command palette to this doc (#447) * Add details about the command used to print the table (#446) * initialPos -> initialPosition (#445) * Add tip on extensions for configuration files (#440) * Add tip on extensions for configuration files Resolves #423 * fix numbering Co-authored-by: Matt Wojciakowski <mattwoj@microsoft.com> * Corrected path (#434) The LocalAppData path was missing `{app-name}` * Update panes.md (#432) Minor edit on a shortcut key * Correct $PROFILE configuration (#431) When using winget, Oh-my-posh will not add Set-PoshPrompt to path, the execution will fail. The correct configuration can be found in https://ohmyposh.dev/docs/windows#replace-your-existing-prompt * Add a sample page (#444) * Add FAQ page (#442) * Add FAQ page * Finalize faq v1 * Replace md with yml, add toc * Update with settings UI feedback from kayla * fix image link * Fix preview faq * Add a guide for using OSC9;9 (#449) * I think this is everything we need. Pushing because I don't know if the image paths are right * This should fix the warnings * maybe fix the urls? * typos * Update TerminalDocs/tutorials/new-tab-same-directory.md Co-authored-by: Felix Christl <fchristl@gmail.com> Co-authored-by: Matt Wojciakowski <mattwoj@microsoft.com> Co-authored-by: Felix Christl <fchristl@gmail.com> * Minor quake mode text update (#454) * DocuTune: Fix ms.topic values (#453) Co-authored-by: Kayla Cinnamon <cinnamon@microsoft.com> Co-authored-by: Floris Westerman <me@floriswesterman.nl> Co-authored-by: Mike Griese <migrie@microsoft.com> Co-authored-by: Schuyler Rosefield <Rosefield@users.noreply.github.com> Co-authored-by: Sean Jacobs <Sophismata@users.noreply.github.com> Co-authored-by: Leon Liang <lelian@microsoft.com> Co-authored-by: Carlos Zamora <carlos.zamora@microsoft.com> Co-authored-by: Pankaj Bhojwani <pabhojwa@microsoft.com> Co-authored-by: PankajBhojwani <pankaj.d.bhoj@gmail.com> Co-authored-by: Nivaldo Tokuda <ni.h1@hotmail.com> Co-authored-by: David A. Sjøen <dasjoen@gmail.com> Co-authored-by: tharindu sathischandra <34299693+tharindusathis@users.noreply.github.com> Co-authored-by: Cutano <rinne@rinne.top> Co-authored-by: Felix Christl <fchristl@gmail.com> Co-authored-by: Alex Buck <abuck@microsoft.com>
* Add powerline redirect (#439) * Add redirect for old powerline page * Add vscode to gitignore * Main > Live (#448) * Update to change equal symbol to plus key Addresses issue #196 *On my Surface Book keyboard + and = are the same key, but this may not be the case for all keyboard layouts. * change + to plus as shipped by default * Add notes about title change persistance * Update settings.json section * Link settings.json mentions * Fix links * fix a few more links * Update TerminalDocs/customize-settings/actions.md Co-authored-by: Kayla Cinnamon <cinnamon@microsoft.com> * Update TerminalDocs/dynamic-profiles.md Co-authored-by: Kayla Cinnamon <cinnamon@microsoft.com> * Update TerminalDocs/customize-settings/actions.md Co-authored-by: Kayla Cinnamon <cinnamon@microsoft.com> * Remove repititious section * Added browser media keys (#371) * Add link to what is command line shell video (#377) * add intenseTextStyle to the docs (#381) * Multiple new pane features (#383) Documentation for - microsoft/terminal#10713 - microsoft/terminal#10638 - microsoft/terminal#10780 - microsoft/terminal#10927 * wt.exe --window argument now available (#388) * Add notes that the `font` object is only 1.10+ (#389) Co-authored-by: Kayla Cinnamon <cinnamon@microsoft.com> * Remove MinimizeToTray action mentions (#387) * Docs updates for 1.11 release (#397) * Specify OS version availability for defterm (#417) Co-authored-by: Kayla Cinnamon <cinnamon@microsoft.com> * Remove tilde Reshttps://github.com/MicrosoftDocs/terminal/issues/260olves * Improve dup tab description #292 * Update minimizetotray setting to new name * Merge release 1.12 into master (#428) Co-authored-by: Kayla Cinnamon <cinnamon@microsoft.com> Co-authored-by: Pankaj Bhojwani <pabhojwa@microsoft.com> Co-authored-by: Matt Wojciakowski <mattwoj@microsoft.com> Co-authored-by: Mike Griese <migrie@microsoft.com> Co-authored-by: Carlos Zamora <carlos.zamora@microsoft.com> Co-authored-by: Schuyler Rosefield <Rosefield@users.noreply.github.com> Co-authored-by: PankajBhojwani <pankaj.d.bhoj@gmail.com> * Remove preview labels * Add redirect for old powerline page * Add vscode to gitignore * Config changes to reflect the default branch from master to main. * Add a note about the command palette to this doc (#447) * Add details about the command used to print the table (#446) * initialPos -> initialPosition (#445) * Add tip on extensions for configuration files (#440) * Add tip on extensions for configuration files Resolves #423 * fix numbering Co-authored-by: Matt Wojciakowski <mattwoj@microsoft.com> * Corrected path (#434) The LocalAppData path was missing `{app-name}` * Update panes.md (#432) Minor edit on a shortcut key * Correct $PROFILE configuration (#431) When using winget, Oh-my-posh will not add Set-PoshPrompt to path, the execution will fail. The correct configuration can be found in https://ohmyposh.dev/docs/windows#replace-your-existing-prompt * Add a sample page (#444) * Add FAQ page (#442) * Add FAQ page * Finalize faq v1 * Replace md with yml, add toc * Update with settings UI feedback from kayla * fix image link * Fix preview faq Co-authored-by: Kayla Cinnamon <cinnamon@microsoft.com> Co-authored-by: Floris Westerman <me@floriswesterman.nl> Co-authored-by: Mike Griese <migrie@microsoft.com> Co-authored-by: Schuyler Rosefield <Rosefield@users.noreply.github.com> Co-authored-by: Sean Jacobs <Sophismata@users.noreply.github.com> Co-authored-by: Leon Liang <lelian@microsoft.com> Co-authored-by: Carlos Zamora <carlos.zamora@microsoft.com> Co-authored-by: Pankaj Bhojwani <pabhojwa@microsoft.com> Co-authored-by: PankajBhojwani <pankaj.d.bhoj@gmail.com> Co-authored-by: Nivaldo Tokuda <ni.h1@hotmail.com> Co-authored-by: David A. Sjøen <dasjoen@gmail.com> Co-authored-by: tharindu sathischandra <34299693+tharindusathis@users.noreply.github.com> Co-authored-by: Cutano <rinne@rinne.top> * Toc update (#457) * Update to change equal symbol to plus key Addresses issue #196 *On my Surface Book keyboard + and = are the same key, but this may not be the case for all keyboard layouts. * change + to plus as shipped by default * Add notes about title change persistance * Update settings.json section * Link settings.json mentions * Fix links * fix a few more links * Update TerminalDocs/customize-settings/actions.md Co-authored-by: Kayla Cinnamon <cinnamon@microsoft.com> * Update TerminalDocs/dynamic-profiles.md Co-authored-by: Kayla Cinnamon <cinnamon@microsoft.com> * Update TerminalDocs/customize-settings/actions.md Co-authored-by: Kayla Cinnamon <cinnamon@microsoft.com> * Remove repititious section * Added browser media keys (#371) * Add link to what is command line shell video (#377) * add intenseTextStyle to the docs (#381) * Multiple new pane features (#383) Documentation for - microsoft/terminal#10713 - microsoft/terminal#10638 - microsoft/terminal#10780 - microsoft/terminal#10927 * wt.exe --window argument now available (#388) * Add notes that the `font` object is only 1.10+ (#389) Co-authored-by: Kayla Cinnamon <cinnamon@microsoft.com> * Remove MinimizeToTray action mentions (#387) * Docs updates for 1.11 release (#397) * Specify OS version availability for defterm (#417) Co-authored-by: Kayla Cinnamon <cinnamon@microsoft.com> * Remove tilde Reshttps://github.com/MicrosoftDocs/terminal/issues/260olves * Improve dup tab description #292 * Update minimizetotray setting to new name * Merge release 1.12 into master (#428) Co-authored-by: Kayla Cinnamon <cinnamon@microsoft.com> Co-authored-by: Pankaj Bhojwani <pabhojwa@microsoft.com> Co-authored-by: Matt Wojciakowski <mattwoj@microsoft.com> Co-authored-by: Mike Griese <migrie@microsoft.com> Co-authored-by: Carlos Zamora <carlos.zamora@microsoft.com> Co-authored-by: Schuyler Rosefield <Rosefield@users.noreply.github.com> Co-authored-by: PankajBhojwani <pankaj.d.bhoj@gmail.com> * Remove preview labels * Add redirect for old powerline page * Add vscode to gitignore * Config changes to reflect the default branch from master to main. * Add a note about the command palette to this doc (#447) * Add details about the command used to print the table (#446) * initialPos -> initialPosition (#445) * Add tip on extensions for configuration files (#440) * Add tip on extensions for configuration files Resolves #423 * fix numbering Co-authored-by: Matt Wojciakowski <mattwoj@microsoft.com> * Corrected path (#434) The LocalAppData path was missing `{app-name}` * Update panes.md (#432) Minor edit on a shortcut key * Correct $PROFILE configuration (#431) When using winget, Oh-my-posh will not add Set-PoshPrompt to path, the execution will fail. The correct configuration can be found in https://ohmyposh.dev/docs/windows#replace-your-existing-prompt * Add a sample page (#444) * Add FAQ page (#442) * Add FAQ page * Finalize faq v1 * Replace md with yml, add toc * Update with settings UI feedback from kayla * fix image link * Fix preview faq * Add a guide for using OSC9;9 (#449) * I think this is everything we need. Pushing because I don't know if the image paths are right * This should fix the warnings * maybe fix the urls? * typos * Update TerminalDocs/tutorials/new-tab-same-directory.md Co-authored-by: Felix Christl <fchristl@gmail.com> Co-authored-by: Matt Wojciakowski <mattwoj@microsoft.com> Co-authored-by: Felix Christl <fchristl@gmail.com> * Minor quake mode text update (#454) * DocuTune: Fix ms.topic values (#453) Co-authored-by: Kayla Cinnamon <cinnamon@microsoft.com> Co-authored-by: Floris Westerman <me@floriswesterman.nl> Co-authored-by: Mike Griese <migrie@microsoft.com> Co-authored-by: Schuyler Rosefield <Rosefield@users.noreply.github.com> Co-authored-by: Sean Jacobs <Sophismata@users.noreply.github.com> Co-authored-by: Leon Liang <lelian@microsoft.com> Co-authored-by: Carlos Zamora <carlos.zamora@microsoft.com> Co-authored-by: Pankaj Bhojwani <pabhojwa@microsoft.com> Co-authored-by: PankajBhojwani <pankaj.d.bhoj@gmail.com> Co-authored-by: Nivaldo Tokuda <ni.h1@hotmail.com> Co-authored-by: David A. Sjøen <dasjoen@gmail.com> Co-authored-by: tharindu sathischandra <34299693+tharindusathis@users.noreply.github.com> Co-authored-by: Cutano <rinne@rinne.top> Co-authored-by: Felix Christl <fchristl@gmail.com> Co-authored-by: Alex Buck <abuck@microsoft.com> Co-authored-by: Kayla Cinnamon <cinnamon@microsoft.com> Co-authored-by: Floris Westerman <me@floriswesterman.nl> Co-authored-by: Mike Griese <migrie@microsoft.com> Co-authored-by: Schuyler Rosefield <Rosefield@users.noreply.github.com> Co-authored-by: Sean Jacobs <Sophismata@users.noreply.github.com> Co-authored-by: Leon Liang <lelian@microsoft.com> Co-authored-by: Carlos Zamora <carlos.zamora@microsoft.com> Co-authored-by: Pankaj Bhojwani <pabhojwa@microsoft.com> Co-authored-by: PankajBhojwani <pankaj.d.bhoj@gmail.com> Co-authored-by: Nivaldo Tokuda <ni.h1@hotmail.com> Co-authored-by: David A. Sjøen <dasjoen@gmail.com> Co-authored-by: tharindu sathischandra <34299693+tharindusathis@users.noreply.github.com> Co-authored-by: Cutano <rinne@rinne.top> Co-authored-by: Felix Christl <fchristl@gmail.com> Co-authored-by: Alex Buck <abuck@microsoft.com>
Summary of the Pull Request
Add functionality to swap a pane with an adjacent (Up/Down/Left/Right) neighbor.
References
This work potentially touches on: #1000 #2398 and #4922
PR Checklist
SwapPanes
function is added but not hooked up, no detach functionality)Detailed Description of the Pull Request / Additional comments
Its been a while since I've written C++ code, and it is my first time working on a Windows application. I hope that I have not made too many mistakes.
Work currently done:
MovePane
function that finds the focused pane, and then tries to finda pane that is visually adjacent to according to direction.
SwapPanes
function that swaps the tree location of two panes_FindFocusAndNeighbor
and_FindNeighborFromFocus
that search the tree for the currently focused pane, and then climbs back up the tree
to try to find a sibling pane that is adjacent to it.
Next steps:
_FindFocusAndNeighbor
, etc) could be utilized to also solve Use visual layout for moveFocusX target #2398 by updating theNavigateFocus
function.Validation Steps Performed
At this point, compilation and manual testing of functionality (with hotkeys) by creating panes, adding distinguishers to each pane, and then swapping them around to confirm they went to the right location.