-
Notifications
You must be signed in to change notification settings - Fork 8.9k
Separate pruning of elevated/unelevated session buffers #19546
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
Conversation
This comment has been minimized.
This comment has been minimized.
carlos-zamora
left a comment
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.
There's a few changes I'm confused about:
- Package-Dev.appxmanifest
- common.build.pre.props
I also think we want to keep the distinction between PersistLayout and PersistAll for #19341. May be worth testing persistence with both values, to be safe.
| sessionIds.emplace(terminalArgs.SessionId()); | ||
| control.PersistTo(reinterpret_cast<int64_t>(file.get())); | ||
| bufferFilenames.emplace(std::move(filename)); |
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.
Shouldn't we only do this if _app.Logic().Settings().GlobalSettings().FirstWindowPreference() == FirstWindowPreference::PersistedLayoutAndContent?
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.
Above, I initialize the persistBuffers variable with exactly that. This entire block of code is skipped if it's false.
| MovePane, | ||
| PersistLayout, | ||
| PersistAll | ||
| Persist, |
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.
Don't we want to keep the distinction between PersistLayout and PersistAll? See #19341
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.
Not anymore. Now, this code doesn't persist the content anymore, so any Persist will be a PersistLayout.
| } | ||
| break; | ||
| } | ||
| case BuildStartupKind::PersistLayout: |
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.
Seems like we'd want to keep the branches separate
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.
Hmm you're right that what used to be PersistLayout, now also gets assigned a SessionId. I wonder if that's a problem... It does cause our app to try and load the corresponding buffer_{guid}.txt file, which doesn't exist (because contents didn't get persisted), but that will just silently fail. I'm not 100% sure how big of a deal this is. It's nice that we have 1 enum less IMO.
Previously, launching an unelevated session after an elevated one would delete the latter's persisted buffers, and vice versa of course. Also, elevated buffers didn't have an ACL forbidding access to unelevated users. That's also fixed now.
Closes #19526
Validation Steps Performed
buffer_are renamed toelevated_if needed ✅