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

Don't let a window be created with the literal name "new" #15323

Merged

Conversation

zadjii-msft
Copy link
Member

As on the tin.

Blocking for 1.18.

Tracked in #14957

As on the tin.

Blocking for 1.18.

Tracked in #14957
// Don't let the window literally be named "-1", because that's silly
auto request = winrt::make_self<implementation::WindowRequestedArgs>(window == L"-1" ? L"" : window,
// Don't let the window literally be named "-1", because that's silly. Same with "new"
const bool nameIsReserved = window == L"-1" || window == L"new";
Copy link
Member

Choose a reason for hiding this comment

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

should we just use -1 in the action instead of the magic word "new"?

fwiw: is new already a magic word? if not, have we accidentally made it one?

Copy link
Member Author

Choose a reason for hiding this comment

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

AppLogic::_doFindTargetWindow has it as a magic word.

Windows Terminal Session Management # Scenario: Run wt in the current window

If window-id is a negative number, or the reserved name new, run the commands in a new Terminal window.

</discuss>

Copy link
Member

Choose a reason for hiding this comment

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

Fair. I will ask, then: why do we need to special case it in more than one place? Shouldn't all window finding and creation go through the same funnel?

Copy link
Member Author

Choose a reason for hiding this comment

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

Boy wouldn't that be nice. As it is, finding a window depends on knowing what the glomming setting is, so that needs to have access to the settings, whereas creation doesn't so much. So finding can't get out of TerminalApp.

Could creation / move to be merged in with find? maybe?

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.

discus

@microsoft-github-policy-service microsoft-github-policy-service bot added Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something and removed Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something labels May 10, 2023
@zadjii-msft
Copy link
Member Author

IMO, when someone's looking through the defaults.json, window: new will make immediate sense, where window: -1 won't.

// Don't let the window literally be named "-1", because that's silly
auto request = winrt::make_self<implementation::WindowRequestedArgs>(window == L"-1" ? L"" : window,
// Don't let the window literally be named "-1", because that's silly. Same with "new"
const bool nameIsReserved = window == L"-1" || window == L"new";
Copy link
Member

Choose a reason for hiding this comment

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

Fair. I will ask, then: why do we need to special case it in more than one place? Shouldn't all window finding and creation go through the same funnel?

@zadjii-msft zadjii-msft added the AutoMerge Marked for automatic merge by the bot when requirements are met label May 11, 2023
@microsoft-github-policy-service microsoft-github-policy-service bot deleted the dev/migrie/b/dont-let-windows-be-new branch May 11, 2023 12:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
AutoMerge Marked for automatic merge by the bot when requirements are met zBugBash-Consider
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants