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

A very sensible Pane refactoring #15232

Merged

Conversation

zadjii-msft
Copy link
Member

It seemed dangerous to just have places all over Pane where we manipulate the whole cadre of TermControl events. Seemed ripe for a copypasta error. This moves that around, so there's only two methods for messing with the TermControl callbacks: _setupControlEvents and _removeControlEvents.

Closes: nothing. This was an off-the-cuff commit that seemed valuable.

Copy link
Member

@DHowett DHowett left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While we're here, should we consider switching to auto_revokers?

winrt::event_token _connectionStateChanged{ 0 };
winrt::event_token _warningBell{ 0 };
winrt::event_token _closeTerminalRequested{ 0 };
winrt::Microsoft::Terminal::Control::TermControl::ConnectionStateChanged_revoker _ConnectionStateChanged;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor nit: we should avoid _Uppercase in new code

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have half a mind for some sort of xmacro / til template for stuff like this. There's now a collection of places where we're all setting up revokers like this. Like, there's gotta be a better way.... Anywho, this was me being preemptive, which is not always warranted

@zadjii-msft zadjii-msft added AutoMerge Marked for automatic merge by the bot when requirements are met Area-CodeHealth Issues related to code cleanliness, linting, rules, warnings, errors, static analysis, etc. labels Apr 25, 2023
@microsoft-github-policy-service microsoft-github-policy-service bot enabled auto-merge (squash) April 25, 2023 20:31
@microsoft-github-policy-service microsoft-github-policy-service bot deleted the dev/migrie/eim/sensible-pane-chuckle branch April 25, 2023 20:58
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. AutoMerge Marked for automatic merge by the bot when requirements are met
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants