-
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
rename profiles.json to settings.json, clean up the defaults #5199
Conversation
This commit also changes Get*Settings from returning a string to returning a std::filesystem::path. We gain in expressiveness without a loss in clarity (since path still supports .c_str()). NOTE: I tried to do an atomic rename with the handle open, but it didn't work for reparse points (it moves the destination of a symbolic link out into the settings folder directly.) Fixes #5186 --- snip for atomic rename code --- auto path{ pathToSettingsFile.wstring() }; auto renameBufferSize{ sizeof(FILE_RENAME_INFO) + (path.size() * sizeof(wchar_t)) }; auto renameBuffer{ std::make_unique<std::byte[]>(renameBufferSize) }; auto renameInfo{ reinterpret_cast<FILE_RENAME_INFO*>(renameBuffer.get()) }; renameInfo->Flags = FILE_RENAME_FLAG_REPLACE_IF_EXISTS | FILE_RENAME_FLAG_POSIX_SEMANTICS; renameInfo->RootDirectory = nullptr; renameInfo->FileNameLength = gsl::narrow_cast<DWORD>(path.size()); std::copy(path.cbegin(), path.cend(), std::begin(renameInfo->FileName)); THROW_IF_WIN32_BOOL_FALSE(SetFileInformationByHandle(hLegacyFile.get(), FileRenameInfo, renameBuffer.get(), gsl::narrow_cast<DWORD>(renameBufferSize))); -----------------------------------
This comment has been minimized.
This comment has been minimized.
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.
Looks good to me
@leonMSFT should approve this so that we get the whole team to approve it haha |
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.
i gotchu
lol y’all |
I guess I should update my PR for WT env vars? |
Yeah! That'd be excellent. |
Hello @DHowett-MSFT! Because this pull request has the 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 (
|
@DHowett-MSFT Done. |
🎉 Handy links: |
* Add Windows Terminal adapter * [Windows Terminal] Get defaultProfile on globals * [Windows Terminal] Update with latest version - profiles.json to settings.json microsoft/terminal#5199 - Change current profile microsoft/terminal#4852 * [Windows Terminal] Rename adapter to pass tests * [Windows Terminal] Update with default profile settings https://github.com/microsoft/terminal/blob/master/doc/user-docs/UsingJsonSettings.md#default-settings
This pull request migrates
profiles.json
tosettings.json
and removes the legacy roaming AppData settings migrator.It also:
Fixes #5186.
Fixes #3291.
categorize key bindings
sync universal with main
kill stray newlines in template files
move profiles.json to settings.json
This commit also changes Get*Settings from returning a string to
returning a std::filesystem::path. We gain in expressiveness without a
loss in clarity (since path still supports .c_str()).
NOTE: I tried to do an atomic rename with the handle open, but it didn't
work for reparse points (it moves the destination of a symbolic link
out into the settings folder directly.)
(snip for atomic rename code)
(end snip)
Stop resurrecting dead roaming profiles