-
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
Introduce abstraction layer between TermControl and TerminalCore (aka Interactivity) #6842
Labels
Area-CodeHealth
Issues related to code cleanliness, linting, rules, warnings, errors, static analysis, etc.
Area-TerminalControl
Issues pertaining to the terminal control (input, selection, keybindings, mouse interaction, etc.)
Area-WPFControl
Things related to the WPF version of the TermControl
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.
Milestone
Comments
carlos-zamora
added
Issue-Feature
Complex enough to require an in depth planning process and actual budgeted, scheduled work.
Product-Terminal
The new Windows Terminal.
Area-CodeHealth
Issues related to code cleanliness, linting, rules, warnings, errors, static analysis, etc.
labels
Jul 8, 2020
ghost
added
the
Needs-Triage
It's a new issue that the core contributor team needs to triage at the next triage meeting
label
Jul 8, 2020
This was referenced Jul 8, 2020
DHowett
added
Area-Output
Related to output processing (inserting text into buffer, retrieving buffer text, etc.)
Area-TerminalControl
Issues pertaining to the terminal control (input, selection, keybindings, mouse interaction, etc.)
Area-WPFControl
Things related to the WPF version of the TermControl
and removed
Area-Output
Related to output processing (inserting text into buffer, retrieving buffer text, etc.)
Needs-Triage
It's a new issue that the core contributor team needs to triage at the next triage meeting
labels
Jul 9, 2020
3 tasks
Alright, as of 2ac8318, this is fundamentally pulled into 3 files, but there's still a lot of work to do. I'm using this comment to track that.
Post- 5dc1632
Other scenarios to check:
Tests to write:
|
2 tasks
ghost
pushed a commit
that referenced
this issue
Apr 5, 2021
Does what it says on the can. This is a follow up to #9472. Now that we have a control .lib, we can add tests for it. Unfortunately, the `TermControl` itself is a horrible mess. So this new unittest lib is empty for now. I'm working on actual tests as a part of #6842, but this PR is here to keep the diffs smaller. Also, apparently `server.vcxproj` had the wrong GUID in it. * [x] I work here * [x] Adds tests
This was referenced Apr 6, 2021
5 tasks
|
ghost
added
the
Resolution-Fix-Committed
Fix is checked in, but it might be 3-4 weeks until a release.
label
Apr 27, 2021
ghost
pushed a commit
that referenced
this issue
Apr 27, 2021
) ## Summary of the Pull Request Brace yourselves, it's finally here. This PR does the dirty work of splitting the monolithic `TermControl` into three components. These components are: * `ControlCore`: This encapsulates the `Terminal` instance, the `DxEngine` and `Renderer`, and the `Connection`. This is intended to everything that someone might need to stand up a terminal instance in a control, but without any regard for how the UX works. * `ControlInteractivity`: This is a wrapper for the `ControlCore`, which holds the logic for things like double-click, right click copy/paste, selection, etc. This is intended to be a UI framework-independent abstraction. The methods this layer exposes can be called the same from both the WinUI TermControl and the WPF control. * `TermControl`: This is the UWP control. It's got a Core and Interactivity inside it, which it uses for the actual logic of the terminal itself. TermControl's main responsibility is now By splitting into smaller pieces, it will enable us to * write unit tests for the `Core` and `Interactivity` bits, which we desparately need * Combine `ControlCore` and `ControlInteractivity` in an out-of-proc core process in the future, to enable tab tearout. However, we're not doing that work quite yet. There's still lots of work to be done to enable that, thought this is likely the biggest portion. Ideally, this would just be methods moved wholesale from one file to another. Unfortunately, there are a bunch of cases where that didn't work as well as expected. Especially when trying to better enforce the boundary between the classes. We've got a couple tests here that I've added. These are partially examples, and partially things I ran into while implementing this. A bunch of things from #7001 can go in now that we have this. This PR is gonna be a huge pain to review - 38 files with 3,730 additions and 1,661 deletions is nothing to scoff at. It will also conflict 100% with anything that's targeting `TermControl`. I'm hoping we can review this over the course of the next week and just be done with it, and leave plenty of runway for 1.9 bugs in post. ## References * In pursuit of #1256 * Proc Model: #5000 * https://github.com/microsoft/terminal/projects/5 ## PR Checklist * [x] Closes #6842 * [x] Closes https://github.com/microsoft/terminal/projects/5#card-50760249 * [x] Closes https://github.com/microsoft/terminal/projects/5#card-50760258 * [x] I work here * [x] Tests added/passed * [n/a] Requires documentation to be updated ## Detailed Description of the Pull Request / Additional comments * I don't love the names `ControlCore` and `ControlInteractivity`. Open to other names. * I added a `ICoreState` interface for "properties that come from the `ControlCore`, but consumers of the `TermControl` need to know". In the future, these will all need to be handled specially, because they might involve an RPC call to retrieve the info from the core (or cache it) in the window process. * I've added more `EventArgs` to make more events proper `TypedEvent`s. * I've changed how the TerminalApp layer requests updated TaskbarProgress state. It doesn't need to pump TermControl to raise a new event anymore. * ~~Something that snuck into this branch in the very long history is the switch to `DCompositionCreateSurfaceHandle` for the `DxEngine`. @miniksa wrote this originally in 30b8335, I'm just finally committing it here. We'll need that in the future for the out-of-proc stuff.~~ * I reverted this in c113b65. We can revert _that_ commit when we want to come back to it. * I've changed the acrylic handler a decent amount. But added tests! * All the `ThrottledFunc` things are left in `TermControl`. Some might be able to move down into core/interactivity, but once we figure out how to use a different kind of Dispatcher (because a UI thread won't necessarily exist for those components). * I've undoubtably messed up the merging of the locking around the appearance config stuff recently ## Validation Steps Performed I've got a rolling list in #6842 (comment) that I'm updating as I go.
🎉This issue was addressed in #9820, which has now been successfully released as 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-CodeHealth
Issues related to code cleanliness, linting, rules, warnings, errors, static analysis, etc.
Area-TerminalControl
Issues pertaining to the terminal control (input, selection, keybindings, mouse interaction, etc.)
Area-WPFControl
Things related to the WPF version of the TermControl
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.
Description of the new feature/enhancement
We have some redundant code between the WPF Control and the UWP TermControl. This indicates a missing layer of abstraction between the TerminalCore and the TermControl. Some benefits that we could/would get from introducing an "interactivity" layer includes...
Proposed technical implementation details (optional)
Specific interactions that could be abstracted better include (but are not limited to)...
\cc @DHowett
The text was updated successfully, but these errors were encountered: