-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
General improvements in preparation for #16598 #16601
Conversation
2df1ae8
to
5270766
Compare
@@ -142,6 +142,9 @@ void WindowEmperor::WaitForWindows() | |||
TranslateMessage(&message); | |||
DispatchMessage(&message); | |||
} | |||
|
|||
_finalizeSessionPersistence(); | |||
TerminateProcess(GetCurrentProcess(), 0); |
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.
this conflicts with #16575 right?
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.
Yep, this is just a reminder for me for when I resolve the merge conflicts.
// This is just like StringFromGUID2 but with lowercase hexadecimal. | ||
wchar_t buffer[39]; | ||
swprintf_s(&buffer[0], 39, L"{%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}", guid.Data1, guid.Data2, guid.Data3, guid.Data4[0], guid.Data4[1], guid.Data4[2], guid.Data4[3], guid.Data4[4], guid.Data4[5], guid.Data4[6], guid.Data4[7]); | ||
return { &buffer[offset], length }; |
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.
rofl i love this
return wil::str_printf<std::wstring>(L"{%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}", guid.Data1, guid.Data2, guid.Data3, guid.Data4[0], guid.Data4[1], guid.Data4[2], guid.Data4[3], guid.Data4[4], guid.Data4[5], guid.Data4[6], guid.Data4[7]); | ||
// This is just like StringFromGUID2 but with lowercase hexadecimal. | ||
wchar_t buffer[39]; | ||
swprintf_s(&buffer[0], 39, L"{%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}", guid.Data1, guid.Data2, guid.Data3, guid.Data4[0], guid.Data4[1], guid.Data4[2], guid.Data4[3], guid.Data4[4], guid.Data4[5], guid.Data4[6], guid.Data4[7]); |
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.
if we use fmt with FMT_COMPILE
does that get smaller? better? worse?
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.
okay so you can't hand-edit state.json
and have it hot-reload anymore, but that seems totally reasonable
This contains all the parts of #16598 that aren't specific to session
restore, but are required for the code in #16598:
{}
brackets.SessionId
to theITerminalConnection
interface.ApplicationState
before we terminate the process.state.json
for changes is important as it preventsdisturbing the session state while session persistence is ongoing.
That's because when
ApplicationState
flushes to disk, the FSmonitor will be triggered and reload the
ApplicationState
again.