-
Notifications
You must be signed in to change notification settings - Fork 8.4k
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
Don't let a window be created with the literal name "new" #15323
Conversation
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"; |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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 namenew
, run the commands in a new Terminal window.
</discuss>
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
discus
IMO, when someone's looking through the defaults.json, |
// 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"; |
There was a problem hiding this comment.
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?
As on the tin.
Blocking for 1.18.
Tracked in #14957