Fix enter to restart the first pane in a split#16001
Merged
Conversation
lhecker
reviewed
Sep 19, 2023
| // the focus here will give the same effect though. | ||
| _UpdateActivePane(newPane); | ||
|
|
||
| return { original, newPane }; |
Member
There was a problem hiding this comment.
Nothing uses the newPane tuple value. Do we need it?
Member
Author
There was a problem hiding this comment.
Not really, but I included it for parity with Pane::Split. Seemed to me like they should return the same thing
lhecker
approved these changes
Sep 20, 2023
DHowett
approved these changes
Sep 20, 2023
DHowett
pushed a commit
that referenced
this pull request
Sep 22, 2023
I noticed this last week, but forgot to file. If you have a pair of splits, and `exit -1` the first, you can't use `enter` to restart it. This PR fixes that. Basically, `TerminalPage` registers it's `_restartPaneConnection` handler when it makes a new `Pane` object. It registers the callback straight to the `Pane`. However, when a `Pane` gets split, it makes a _new_ `Pane` object, and moves the original content into the new pane. `TerminalPage` however, would never hook up its own callback to that newly created pane. This fixes that. (cherry picked from commit 9b986a1) Service-Card-Id: 90584595 Service-Version: 1.18
1 task
zadjii-msft
added a commit
that referenced
this pull request
Mar 26, 2024
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I noticed this last week, but forgot to file. If you have a pair of splits, and
exit -1the first, you can't useenterto restart it.This PR fixes that. Basically,
TerminalPageregisters it's_restartPaneConnectionhandler when it makes a newPaneobject. It registers the callback straight to thePane. However, when aPanegets split, it makes a newPaneobject, and moves the original content into the new pane.TerminalPagehowever, would never hook up its own callback to that newly created pane.This fixes that.