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

Move ICore/ControlSettings to TerminalControl project #7167

Merged
10 commits merged into from
Aug 7, 2020

Conversation

carlos-zamora
Copy link
Member

@carlos-zamora carlos-zamora commented Aug 3, 2020

Summary of the Pull Request

Move ICoreSettings and IControlSettings from the TerminalSettings project to the TerminalCore and TerminalControl projects respectively. Also entirely removes the TerminalSettings project.

The purpose of these interfaces is unchanged. ICoreSettings is used to instantiate a terminal. IControlSettings (which requires an ICoreSettings) is used to instantiate a UWP terminal control.

References

Closes #7140
Related Epic: #885
Related Spec: #6904

PR Checklist

Detailed Description of the Pull Request / Additional comments

A lot of the work here was having to deal with winmd files across all of these projects. The TerminalCore project now outputs a Microsoft.Terminal.TerminalControl.winmd. Some magic happens in TerminalControl.vcxproj to get this to work properly.

Validation Steps Performed

Deployed Windows Terminal and opened a few new tabs.

@ghost ghost added Area-CodeHealth Issues related to code cleanliness, linting, rules, warnings, errors, static analysis, etc. Issue-Task It's a feature request, but it doesn't really need a major design. Product-Terminal The new Windows Terminal. labels Aug 3, 2020
@carlos-zamora

This comment has been minimized.

@carlos-zamora carlos-zamora marked this pull request as ready for review August 5, 2020 18:06
Copy link
Member

@zadjii-msft zadjii-msft left a comment

Choose a reason for hiding this comment

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

I'm at 35/67 but it's 5p here, so here's some initial feedback

src/cascadia/TerminalApp/CommandPalette.cpp Outdated Show resolved Hide resolved
src/cascadia/TerminalControl/TSFInputControl.cpp Outdated Show resolved Hide resolved
src/cascadia/TerminalControl/TermControl.cpp Outdated Show resolved Hide resolved
src/cascadia/TerminalApp/CommandPalette.cpp Outdated Show resolved Hide resolved
src/cascadia/TerminalControl/TSFInputControl.cpp Outdated Show resolved Hide resolved
@@ -344,7 +344,7 @@ void Terminal::UpdateSettings(winrt::Microsoft::Terminal::Settings::ICoreSetting

// If the old scrolloffset was 0, then we weren't scrolled back at all
// before, and shouldn't be now either.
_scrollOffset = originalOffsetWasZero ? 0 : ::base::ClampSub(_mutableViewport.Top(), newVisibleTop);
_scrollOffset = originalOffsetWasZero ? 0 : static_cast<int>(::base::ClampSub(_mutableViewport.Top(), newVisibleTop));
Copy link
Member

Choose a reason for hiding this comment

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

this one seems weird. should we just be usinjg ClampSub<int> or something?

Copy link
Member Author

Choose a reason for hiding this comment

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

For whatever reason, this came up:

1>D:\Terminal\src\cascadia\TerminalCore\Terminal.cpp(347,104): error C2445: result type of conditional expression is ambiguous: types 'int' and 'base::internal::ClampedNumeric<short>' can be converted to multiple common types

It's also having trouble converting from ClampedNumeric to the non-clamped numeric type :/

Copy link
Member

Choose a reason for hiding this comment

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

This is bizarre that this is needed now

src/cascadia/TerminalCore/lib/terminalcore-lib.vcxproj Outdated Show resolved Hide resolved
src/cascadia/TerminalCore/lib/terminalcore-lib.vcxproj Outdated Show resolved Hide resolved
@@ -303,7 +303,7 @@ class CommonState
const CONSOLE_INFORMATION& gci = Microsoft::Console::Interactivity::ServiceLocator::LocateGlobals().getConsoleInformation();
// length 80 string of text with bisecting characters at the beginning and end.
// positions of き(\x304d) are at 0, 27-28, 39-40, 67-68, 79
PWCHAR pwszText =
auto pwszText =
Copy link
Member

Choose a reason for hiding this comment

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

interesting. not necessary for this change, i presume, but I'll allow it? 😁

Copy link
Member Author

Choose a reason for hiding this comment

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

Similar to the ClampSub issue above, idk why this came up:

6>D:\Terminal\src\inc\test\CommonState.hpp(306,25): error C2440: 'initializing': cannot convert from 'const wchar_t [81]' to 'PWCHAR'
6>D:\Terminal\src\inc\test\CommonState.hpp(306,25): message : Conversion from string literal loses const qualifier (see /Zc:strictStrings)

🤷‍♂️

@ghost ghost added the Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something label Aug 5, 2020
@ghost ghost removed the Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something label Aug 5, 2020
Copy link
Member

@zadjii-msft zadjii-msft left a comment

Choose a reason for hiding this comment

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

Alright lets do it

@zadjii-msft zadjii-msft added the AutoMerge Marked for automatic merge by the bot when requirements are met label Aug 7, 2020
@ghost
Copy link

ghost commented Aug 7, 2020

Hello @zadjii-msft!

Because this pull request has the AutoMerge label, I will be glad to assist with helping to merge this pull request once all check-in policies pass.

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 (@msftbot) and give me an instruction to get started! Learn more here.

@ghost ghost merged commit 1c6aa4d into master Aug 7, 2020
@ghost ghost deleted the dev/cazamor/set/move-interface-settings branch August 7, 2020 14:47
This pull request 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. AutoMerge Marked for automatic merge by the bot when requirements are met Issue-Task It's a feature request, but it doesn't really need a major design. Product-Terminal The new Windows Terminal.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Move TerminalSettings interfaces
3 participants