Files
terminal/doc/user-docs/UsingJsonSettings.md

477 lines
17 KiB
Markdown
Raw Normal View History

The start of some User docs (#1577) * Start User docs * Fix typos * Addded some more TODO * Update doc/user-docs/index.md Co-Authored-By: Michael Niksa <miniksa@microsoft.com> * Update doc/user-docs/index.md Co-Authored-By: Michael Niksa <miniksa@microsoft.com> * Update doc/user-docs/index.md Co-Authored-By: Michael Niksa <miniksa@microsoft.com> * Update doc/user-docs/index.md Co-Authored-By: Michael Niksa <miniksa@microsoft.com> * Updated from suggestions in the PR * Improve path to profiles.json * Added some details about Json settings * Example Json settings, and a #TODO * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * After review and make colour US. 1. Merged in comments from PR 2. Made colour color :-( 3. Other tidy ups * Added more detais about background images * Remove some TODO comments and minot tidy up * Get rid of TODO 1. Some notes abouet cut and paste -- needs more work 2. Get rid of TODO -- replace with links to issues 3. Add some extra notes about URI for background images
2019-07-09 04:17:19 +10:00
# Editing Windows Terminal JSON Settings
Add Cascading User + Default Settings (#2515) This PR represents the start of the work on Cascading User + default settings, #754. Cascading settings will be done in two parts: * [ ] Layered Default+User settings (this PR) * [ ] Dynamic Profile Generation (#2603). Until _both_ are done, _neither are going in. The dynamic profiles PR will target this PR when it's ready, but will go in as a separate commit into master. This PR covers adding one primary feature: the settings are now in two separate files: * a static `defaults.json` that ships with the package (the "default settings") * a `profiles.json` with the user's customizations (the "user settings) User settings are _layered_ upon the settings in the defaults settings. ## References Other things that might be related here: * #1378 - This seems like it's definitely fixed. The default keybindings are _much_ cleaner, and without the save-on-load behavior, the user's keybindings will be left in a good state * #1398 - This might have honestly been solved by #2475 ## PR Checklist * [x] Closes #754 * [x] Closes #1378 * [x] Closes #2566 * [x] I work here * [x] Tests added/passed * [x] Requires documentation to be updated - it **ABSOLUTELY DOES** ## Detailed Description of the Pull Request / Additional comments 1. We start by taking all of the `FromJson` functions in Profile, ColorScheme, Globals, etc, and converting them to `LayerJson` methods. These are effectively the same, with the change that instead of building a new object, they are simply layering the values on top of `this` object. 2. Next, we add tests for layering properties like that. 3. Now, we add a `defaults.json` to the package. This is the file the users can refer to as our default settings. 4. We then take that `defaults.json` and stamp it into an auto generated `.h` file, so we can use it's data without having to worry about reading it from disk. 5. We then change the `LoadAll` function in `CascadiaSettings`. Now, the function does two loads - one from the defaults, and then a second load from the `profiles.json` file, layering the settings from each source upon the previous values. 6. If the `profiles.json` file doesn't exist, we'll create it from a hardcoded `userDefaults.json`, which is stamped in similar to how `defaults.json` is. 7. We also add support for _unbinding_ keybindings that might exist in the `defaults.json`, but the user doesn't want to be bound to anything. 8. We add support for _hiding_ a profile, which is useful if a user doesn't want one of the default profiles to appear in the list of profiles. ## TODO: * [x] Still need to make Alt+Click work on the settings button * [x] Need to write some user documentation on how the new settings model works * [x] Fix the pair of tests I broke (re: Duplicate profiles) <hr> * Create profiles by layering them * Update test to layer multiple times on the same profile * Add support for layering an array of profiles, but break a couple tests * Add a defaults.json to the package * Layer colorschemes * Moves tests into individual classes * adds support for layering a colorscheme on top of another * Layer an array of color schemes * oh no, this was missed with #2481 must have committed without staging this change, uh oh. Not like those tests actually work so nbd * Layer keybindings * Read settings from defaults.json + profiles.json, layer appropriately This is like 80% of #754. Needs tests. * Add tests for keybindings * add support to unbind a key with `null` or `"unbound"` or `"garbage"` * Layer or clear optional properties * Add a helper to get an optional variable for a bunch of different types In the end, I think we need to ask _was this worth it_ * Do this with the stretch mode too * Add back in the GUID check for profiles * Add some tests for global settings layering * M A D W I T H P O W E R Add a MsBuild target to auto-generate a header with the defaults.json as a string in the file. That way, we can _always_ load the defaults. Literally impossible to not. * When the user's profile.json doesn't exist, create it from a template * Re-order profiles to match the order set in the user's profiles.json * Add tests for re-ordering profiles to match user ordering * Add support for hiding profiles using `"hidden": true` * Use the hardcoded defaults.json for the exception->"use defaults" case * Somehow I messed up the git submodules? * woo documentation * Fix a Terminal.App.Unit.Tests failure * signed/unsigned is hard * Use Alt+Settings button to open the default settings * Missed a signed/unsigned * Some very preliminary PR feedback * More PR feedback Use the wil helper for the exe path Move jsonutils into their own file kill some dead code * Add templates to these bois * remove some code for generating defaults, reorder defaults.json a tad * Make guid a std::optional * Large block of PR feedback * Remove some dead code * add some comments * tag some todos * stl is love, stl is life * add `-noprofile` * Fix the crash that dustin found * -Encoding ASCII * Set a profile's default scheme to Campbell * Fix the tests I regressed * Update UsingJsonSetting.md to reflect that changes from these PRs * Change how GenerateGuidForProfile works * Make AppKeyBindings do its own serialization * Remove leftover dead code from the previous commit * Fix up an enormous number of PR nits * Fix a typo; Update the defaults to match #2378 * Tiny nits * Some typos, PR nits * Fix this broken defaults case
2019-09-16 12:57:10 -07:00
One way (currently the only way) to configure Windows Terminal is by editing the
rename profiles.json to settings.json, clean up the defaults (#5199) This pull request migrates `profiles.json` to `settings.json` and removes the legacy roaming AppData settings migrator. It also: * separates the key bindings in defaults.json into logical groups * syncs the universal terminal defaults with the primary defaults * removes some stray newlines that ended up at the beginning of settings.json and defaults.json 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) ```c++ 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))); ``` (end snip) ### Stop resurrecting dead roaming profiles
2020-04-01 12:09:42 -07:00
`settings.json` settings file. At the time of writing you can open the settings
Add Cascading User + Default Settings (#2515) This PR represents the start of the work on Cascading User + default settings, #754. Cascading settings will be done in two parts: * [ ] Layered Default+User settings (this PR) * [ ] Dynamic Profile Generation (#2603). Until _both_ are done, _neither are going in. The dynamic profiles PR will target this PR when it's ready, but will go in as a separate commit into master. This PR covers adding one primary feature: the settings are now in two separate files: * a static `defaults.json` that ships with the package (the "default settings") * a `profiles.json` with the user's customizations (the "user settings) User settings are _layered_ upon the settings in the defaults settings. ## References Other things that might be related here: * #1378 - This seems like it's definitely fixed. The default keybindings are _much_ cleaner, and without the save-on-load behavior, the user's keybindings will be left in a good state * #1398 - This might have honestly been solved by #2475 ## PR Checklist * [x] Closes #754 * [x] Closes #1378 * [x] Closes #2566 * [x] I work here * [x] Tests added/passed * [x] Requires documentation to be updated - it **ABSOLUTELY DOES** ## Detailed Description of the Pull Request / Additional comments 1. We start by taking all of the `FromJson` functions in Profile, ColorScheme, Globals, etc, and converting them to `LayerJson` methods. These are effectively the same, with the change that instead of building a new object, they are simply layering the values on top of `this` object. 2. Next, we add tests for layering properties like that. 3. Now, we add a `defaults.json` to the package. This is the file the users can refer to as our default settings. 4. We then take that `defaults.json` and stamp it into an auto generated `.h` file, so we can use it's data without having to worry about reading it from disk. 5. We then change the `LoadAll` function in `CascadiaSettings`. Now, the function does two loads - one from the defaults, and then a second load from the `profiles.json` file, layering the settings from each source upon the previous values. 6. If the `profiles.json` file doesn't exist, we'll create it from a hardcoded `userDefaults.json`, which is stamped in similar to how `defaults.json` is. 7. We also add support for _unbinding_ keybindings that might exist in the `defaults.json`, but the user doesn't want to be bound to anything. 8. We add support for _hiding_ a profile, which is useful if a user doesn't want one of the default profiles to appear in the list of profiles. ## TODO: * [x] Still need to make Alt+Click work on the settings button * [x] Need to write some user documentation on how the new settings model works * [x] Fix the pair of tests I broke (re: Duplicate profiles) <hr> * Create profiles by layering them * Update test to layer multiple times on the same profile * Add support for layering an array of profiles, but break a couple tests * Add a defaults.json to the package * Layer colorschemes * Moves tests into individual classes * adds support for layering a colorscheme on top of another * Layer an array of color schemes * oh no, this was missed with #2481 must have committed without staging this change, uh oh. Not like those tests actually work so nbd * Layer keybindings * Read settings from defaults.json + profiles.json, layer appropriately This is like 80% of #754. Needs tests. * Add tests for keybindings * add support to unbind a key with `null` or `"unbound"` or `"garbage"` * Layer or clear optional properties * Add a helper to get an optional variable for a bunch of different types In the end, I think we need to ask _was this worth it_ * Do this with the stretch mode too * Add back in the GUID check for profiles * Add some tests for global settings layering * M A D W I T H P O W E R Add a MsBuild target to auto-generate a header with the defaults.json as a string in the file. That way, we can _always_ load the defaults. Literally impossible to not. * When the user's profile.json doesn't exist, create it from a template * Re-order profiles to match the order set in the user's profiles.json * Add tests for re-ordering profiles to match user ordering * Add support for hiding profiles using `"hidden": true` * Use the hardcoded defaults.json for the exception->"use defaults" case * Somehow I messed up the git submodules? * woo documentation * Fix a Terminal.App.Unit.Tests failure * signed/unsigned is hard * Use Alt+Settings button to open the default settings * Missed a signed/unsigned * Some very preliminary PR feedback * More PR feedback Use the wil helper for the exe path Move jsonutils into their own file kill some dead code * Add templates to these bois * remove some code for generating defaults, reorder defaults.json a tad * Make guid a std::optional * Large block of PR feedback * Remove some dead code * add some comments * tag some todos * stl is love, stl is life * add `-noprofile` * Fix the crash that dustin found * -Encoding ASCII * Set a profile's default scheme to Campbell * Fix the tests I regressed * Update UsingJsonSetting.md to reflect that changes from these PRs * Change how GenerateGuidForProfile works * Make AppKeyBindings do its own serialization * Remove leftover dead code from the previous commit * Fix up an enormous number of PR nits * Fix a typo; Update the defaults to match #2378 * Tiny nits * Some typos, PR nits * Fix this broken defaults case
2019-09-16 12:57:10 -07:00
file in your default editor by selecting `Settings` from the WT pull down menu.
The start of some User docs (#1577) * Start User docs * Fix typos * Addded some more TODO * Update doc/user-docs/index.md Co-Authored-By: Michael Niksa <miniksa@microsoft.com> * Update doc/user-docs/index.md Co-Authored-By: Michael Niksa <miniksa@microsoft.com> * Update doc/user-docs/index.md Co-Authored-By: Michael Niksa <miniksa@microsoft.com> * Update doc/user-docs/index.md Co-Authored-By: Michael Niksa <miniksa@microsoft.com> * Updated from suggestions in the PR * Improve path to profiles.json * Added some details about Json settings * Example Json settings, and a #TODO * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * After review and make colour US. 1. Merged in comments from PR 2. Made colour color :-( 3. Other tidy ups * Added more detais about background images * Remove some TODO comments and minot tidy up * Get rid of TODO 1. Some notes abouet cut and paste -- needs more work 2. Get rid of TODO -- replace with links to issues 3. Add some extra notes about URI for background images
2019-07-09 04:17:19 +10:00
rename profiles.json to settings.json, clean up the defaults (#5199) This pull request migrates `profiles.json` to `settings.json` and removes the legacy roaming AppData settings migrator. It also: * separates the key bindings in defaults.json into logical groups * syncs the universal terminal defaults with the primary defaults * removes some stray newlines that ended up at the beginning of settings.json and defaults.json 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) ```c++ 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))); ``` (end snip) ### Stop resurrecting dead roaming profiles
2020-04-01 12:09:42 -07:00
The settings are stored in the file `$env:LocalAppData\Packages\Microsoft.WindowsTerminal_8wekyb3d8bbwe\LocalState\settings.json`.
The start of some User docs (#1577) * Start User docs * Fix typos * Addded some more TODO * Update doc/user-docs/index.md Co-Authored-By: Michael Niksa <miniksa@microsoft.com> * Update doc/user-docs/index.md Co-Authored-By: Michael Niksa <miniksa@microsoft.com> * Update doc/user-docs/index.md Co-Authored-By: Michael Niksa <miniksa@microsoft.com> * Update doc/user-docs/index.md Co-Authored-By: Michael Niksa <miniksa@microsoft.com> * Updated from suggestions in the PR * Improve path to profiles.json * Added some details about Json settings * Example Json settings, and a #TODO * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * After review and make colour US. 1. Merged in comments from PR 2. Made colour color :-( 3. Other tidy ups * Added more detais about background images * Remove some TODO comments and minot tidy up * Get rid of TODO 1. Some notes abouet cut and paste -- needs more work 2. Get rid of TODO -- replace with links to issues 3. Add some extra notes about URI for background images
2019-07-09 04:17:19 +10:00
Add Cascading User + Default Settings (#2515) This PR represents the start of the work on Cascading User + default settings, #754. Cascading settings will be done in two parts: * [ ] Layered Default+User settings (this PR) * [ ] Dynamic Profile Generation (#2603). Until _both_ are done, _neither are going in. The dynamic profiles PR will target this PR when it's ready, but will go in as a separate commit into master. This PR covers adding one primary feature: the settings are now in two separate files: * a static `defaults.json` that ships with the package (the "default settings") * a `profiles.json` with the user's customizations (the "user settings) User settings are _layered_ upon the settings in the defaults settings. ## References Other things that might be related here: * #1378 - This seems like it's definitely fixed. The default keybindings are _much_ cleaner, and without the save-on-load behavior, the user's keybindings will be left in a good state * #1398 - This might have honestly been solved by #2475 ## PR Checklist * [x] Closes #754 * [x] Closes #1378 * [x] Closes #2566 * [x] I work here * [x] Tests added/passed * [x] Requires documentation to be updated - it **ABSOLUTELY DOES** ## Detailed Description of the Pull Request / Additional comments 1. We start by taking all of the `FromJson` functions in Profile, ColorScheme, Globals, etc, and converting them to `LayerJson` methods. These are effectively the same, with the change that instead of building a new object, they are simply layering the values on top of `this` object. 2. Next, we add tests for layering properties like that. 3. Now, we add a `defaults.json` to the package. This is the file the users can refer to as our default settings. 4. We then take that `defaults.json` and stamp it into an auto generated `.h` file, so we can use it's data without having to worry about reading it from disk. 5. We then change the `LoadAll` function in `CascadiaSettings`. Now, the function does two loads - one from the defaults, and then a second load from the `profiles.json` file, layering the settings from each source upon the previous values. 6. If the `profiles.json` file doesn't exist, we'll create it from a hardcoded `userDefaults.json`, which is stamped in similar to how `defaults.json` is. 7. We also add support for _unbinding_ keybindings that might exist in the `defaults.json`, but the user doesn't want to be bound to anything. 8. We add support for _hiding_ a profile, which is useful if a user doesn't want one of the default profiles to appear in the list of profiles. ## TODO: * [x] Still need to make Alt+Click work on the settings button * [x] Need to write some user documentation on how the new settings model works * [x] Fix the pair of tests I broke (re: Duplicate profiles) <hr> * Create profiles by layering them * Update test to layer multiple times on the same profile * Add support for layering an array of profiles, but break a couple tests * Add a defaults.json to the package * Layer colorschemes * Moves tests into individual classes * adds support for layering a colorscheme on top of another * Layer an array of color schemes * oh no, this was missed with #2481 must have committed without staging this change, uh oh. Not like those tests actually work so nbd * Layer keybindings * Read settings from defaults.json + profiles.json, layer appropriately This is like 80% of #754. Needs tests. * Add tests for keybindings * add support to unbind a key with `null` or `"unbound"` or `"garbage"` * Layer or clear optional properties * Add a helper to get an optional variable for a bunch of different types In the end, I think we need to ask _was this worth it_ * Do this with the stretch mode too * Add back in the GUID check for profiles * Add some tests for global settings layering * M A D W I T H P O W E R Add a MsBuild target to auto-generate a header with the defaults.json as a string in the file. That way, we can _always_ load the defaults. Literally impossible to not. * When the user's profile.json doesn't exist, create it from a template * Re-order profiles to match the order set in the user's profiles.json * Add tests for re-ordering profiles to match user ordering * Add support for hiding profiles using `"hidden": true` * Use the hardcoded defaults.json for the exception->"use defaults" case * Somehow I messed up the git submodules? * woo documentation * Fix a Terminal.App.Unit.Tests failure * signed/unsigned is hard * Use Alt+Settings button to open the default settings * Missed a signed/unsigned * Some very preliminary PR feedback * More PR feedback Use the wil helper for the exe path Move jsonutils into their own file kill some dead code * Add templates to these bois * remove some code for generating defaults, reorder defaults.json a tad * Make guid a std::optional * Large block of PR feedback * Remove some dead code * add some comments * tag some todos * stl is love, stl is life * add `-noprofile` * Fix the crash that dustin found * -Encoding ASCII * Set a profile's default scheme to Campbell * Fix the tests I regressed * Update UsingJsonSetting.md to reflect that changes from these PRs * Change how GenerateGuidForProfile works * Make AppKeyBindings do its own serialization * Remove leftover dead code from the previous commit * Fix up an enormous number of PR nits * Fix a typo; Update the defaults to match #2378 * Tiny nits * Some typos, PR nits * Fix this broken defaults case
2019-09-16 12:57:10 -07:00
As of [#2515](https://github.com/microsoft/terminal/pull/2515), the settings are
rename profiles.json to settings.json, clean up the defaults (#5199) This pull request migrates `profiles.json` to `settings.json` and removes the legacy roaming AppData settings migrator. It also: * separates the key bindings in defaults.json into logical groups * syncs the universal terminal defaults with the primary defaults * removes some stray newlines that ended up at the beginning of settings.json and defaults.json 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) ```c++ 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))); ``` (end snip) ### Stop resurrecting dead roaming profiles
2020-04-01 12:09:42 -07:00
split into _two_ files: a hardcoded `defaults.json`, and `settings.json`, which
Add Cascading User + Default Settings (#2515) This PR represents the start of the work on Cascading User + default settings, #754. Cascading settings will be done in two parts: * [ ] Layered Default+User settings (this PR) * [ ] Dynamic Profile Generation (#2603). Until _both_ are done, _neither are going in. The dynamic profiles PR will target this PR when it's ready, but will go in as a separate commit into master. This PR covers adding one primary feature: the settings are now in two separate files: * a static `defaults.json` that ships with the package (the "default settings") * a `profiles.json` with the user's customizations (the "user settings) User settings are _layered_ upon the settings in the defaults settings. ## References Other things that might be related here: * #1378 - This seems like it's definitely fixed. The default keybindings are _much_ cleaner, and without the save-on-load behavior, the user's keybindings will be left in a good state * #1398 - This might have honestly been solved by #2475 ## PR Checklist * [x] Closes #754 * [x] Closes #1378 * [x] Closes #2566 * [x] I work here * [x] Tests added/passed * [x] Requires documentation to be updated - it **ABSOLUTELY DOES** ## Detailed Description of the Pull Request / Additional comments 1. We start by taking all of the `FromJson` functions in Profile, ColorScheme, Globals, etc, and converting them to `LayerJson` methods. These are effectively the same, with the change that instead of building a new object, they are simply layering the values on top of `this` object. 2. Next, we add tests for layering properties like that. 3. Now, we add a `defaults.json` to the package. This is the file the users can refer to as our default settings. 4. We then take that `defaults.json` and stamp it into an auto generated `.h` file, so we can use it's data without having to worry about reading it from disk. 5. We then change the `LoadAll` function in `CascadiaSettings`. Now, the function does two loads - one from the defaults, and then a second load from the `profiles.json` file, layering the settings from each source upon the previous values. 6. If the `profiles.json` file doesn't exist, we'll create it from a hardcoded `userDefaults.json`, which is stamped in similar to how `defaults.json` is. 7. We also add support for _unbinding_ keybindings that might exist in the `defaults.json`, but the user doesn't want to be bound to anything. 8. We add support for _hiding_ a profile, which is useful if a user doesn't want one of the default profiles to appear in the list of profiles. ## TODO: * [x] Still need to make Alt+Click work on the settings button * [x] Need to write some user documentation on how the new settings model works * [x] Fix the pair of tests I broke (re: Duplicate profiles) <hr> * Create profiles by layering them * Update test to layer multiple times on the same profile * Add support for layering an array of profiles, but break a couple tests * Add a defaults.json to the package * Layer colorschemes * Moves tests into individual classes * adds support for layering a colorscheme on top of another * Layer an array of color schemes * oh no, this was missed with #2481 must have committed without staging this change, uh oh. Not like those tests actually work so nbd * Layer keybindings * Read settings from defaults.json + profiles.json, layer appropriately This is like 80% of #754. Needs tests. * Add tests for keybindings * add support to unbind a key with `null` or `"unbound"` or `"garbage"` * Layer or clear optional properties * Add a helper to get an optional variable for a bunch of different types In the end, I think we need to ask _was this worth it_ * Do this with the stretch mode too * Add back in the GUID check for profiles * Add some tests for global settings layering * M A D W I T H P O W E R Add a MsBuild target to auto-generate a header with the defaults.json as a string in the file. That way, we can _always_ load the defaults. Literally impossible to not. * When the user's profile.json doesn't exist, create it from a template * Re-order profiles to match the order set in the user's profiles.json * Add tests for re-ordering profiles to match user ordering * Add support for hiding profiles using `"hidden": true` * Use the hardcoded defaults.json for the exception->"use defaults" case * Somehow I messed up the git submodules? * woo documentation * Fix a Terminal.App.Unit.Tests failure * signed/unsigned is hard * Use Alt+Settings button to open the default settings * Missed a signed/unsigned * Some very preliminary PR feedback * More PR feedback Use the wil helper for the exe path Move jsonutils into their own file kill some dead code * Add templates to these bois * remove some code for generating defaults, reorder defaults.json a tad * Make guid a std::optional * Large block of PR feedback * Remove some dead code * add some comments * tag some todos * stl is love, stl is life * add `-noprofile` * Fix the crash that dustin found * -Encoding ASCII * Set a profile's default scheme to Campbell * Fix the tests I regressed * Update UsingJsonSetting.md to reflect that changes from these PRs * Change how GenerateGuidForProfile works * Make AppKeyBindings do its own serialization * Remove leftover dead code from the previous commit * Fix up an enormous number of PR nits * Fix a typo; Update the defaults to match #2378 * Tiny nits * Some typos, PR nits * Fix this broken defaults case
2019-09-16 12:57:10 -07:00
contains the user settings. Users should only be concerned with the contents of
rename profiles.json to settings.json, clean up the defaults (#5199) This pull request migrates `profiles.json` to `settings.json` and removes the legacy roaming AppData settings migrator. It also: * separates the key bindings in defaults.json into logical groups * syncs the universal terminal defaults with the primary defaults * removes some stray newlines that ended up at the beginning of settings.json and defaults.json 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) ```c++ 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))); ``` (end snip) ### Stop resurrecting dead roaming profiles
2020-04-01 12:09:42 -07:00
the `settings.json`, which contains their customizations. The `defaults.json`
Add Cascading User + Default Settings (#2515) This PR represents the start of the work on Cascading User + default settings, #754. Cascading settings will be done in two parts: * [ ] Layered Default+User settings (this PR) * [ ] Dynamic Profile Generation (#2603). Until _both_ are done, _neither are going in. The dynamic profiles PR will target this PR when it's ready, but will go in as a separate commit into master. This PR covers adding one primary feature: the settings are now in two separate files: * a static `defaults.json` that ships with the package (the "default settings") * a `profiles.json` with the user's customizations (the "user settings) User settings are _layered_ upon the settings in the defaults settings. ## References Other things that might be related here: * #1378 - This seems like it's definitely fixed. The default keybindings are _much_ cleaner, and without the save-on-load behavior, the user's keybindings will be left in a good state * #1398 - This might have honestly been solved by #2475 ## PR Checklist * [x] Closes #754 * [x] Closes #1378 * [x] Closes #2566 * [x] I work here * [x] Tests added/passed * [x] Requires documentation to be updated - it **ABSOLUTELY DOES** ## Detailed Description of the Pull Request / Additional comments 1. We start by taking all of the `FromJson` functions in Profile, ColorScheme, Globals, etc, and converting them to `LayerJson` methods. These are effectively the same, with the change that instead of building a new object, they are simply layering the values on top of `this` object. 2. Next, we add tests for layering properties like that. 3. Now, we add a `defaults.json` to the package. This is the file the users can refer to as our default settings. 4. We then take that `defaults.json` and stamp it into an auto generated `.h` file, so we can use it's data without having to worry about reading it from disk. 5. We then change the `LoadAll` function in `CascadiaSettings`. Now, the function does two loads - one from the defaults, and then a second load from the `profiles.json` file, layering the settings from each source upon the previous values. 6. If the `profiles.json` file doesn't exist, we'll create it from a hardcoded `userDefaults.json`, which is stamped in similar to how `defaults.json` is. 7. We also add support for _unbinding_ keybindings that might exist in the `defaults.json`, but the user doesn't want to be bound to anything. 8. We add support for _hiding_ a profile, which is useful if a user doesn't want one of the default profiles to appear in the list of profiles. ## TODO: * [x] Still need to make Alt+Click work on the settings button * [x] Need to write some user documentation on how the new settings model works * [x] Fix the pair of tests I broke (re: Duplicate profiles) <hr> * Create profiles by layering them * Update test to layer multiple times on the same profile * Add support for layering an array of profiles, but break a couple tests * Add a defaults.json to the package * Layer colorschemes * Moves tests into individual classes * adds support for layering a colorscheme on top of another * Layer an array of color schemes * oh no, this was missed with #2481 must have committed without staging this change, uh oh. Not like those tests actually work so nbd * Layer keybindings * Read settings from defaults.json + profiles.json, layer appropriately This is like 80% of #754. Needs tests. * Add tests for keybindings * add support to unbind a key with `null` or `"unbound"` or `"garbage"` * Layer or clear optional properties * Add a helper to get an optional variable for a bunch of different types In the end, I think we need to ask _was this worth it_ * Do this with the stretch mode too * Add back in the GUID check for profiles * Add some tests for global settings layering * M A D W I T H P O W E R Add a MsBuild target to auto-generate a header with the defaults.json as a string in the file. That way, we can _always_ load the defaults. Literally impossible to not. * When the user's profile.json doesn't exist, create it from a template * Re-order profiles to match the order set in the user's profiles.json * Add tests for re-ordering profiles to match user ordering * Add support for hiding profiles using `"hidden": true` * Use the hardcoded defaults.json for the exception->"use defaults" case * Somehow I messed up the git submodules? * woo documentation * Fix a Terminal.App.Unit.Tests failure * signed/unsigned is hard * Use Alt+Settings button to open the default settings * Missed a signed/unsigned * Some very preliminary PR feedback * More PR feedback Use the wil helper for the exe path Move jsonutils into their own file kill some dead code * Add templates to these bois * remove some code for generating defaults, reorder defaults.json a tad * Make guid a std::optional * Large block of PR feedback * Remove some dead code * add some comments * tag some todos * stl is love, stl is life * add `-noprofile` * Fix the crash that dustin found * -Encoding ASCII * Set a profile's default scheme to Campbell * Fix the tests I regressed * Update UsingJsonSetting.md to reflect that changes from these PRs * Change how GenerateGuidForProfile works * Make AppKeyBindings do its own serialization * Remove leftover dead code from the previous commit * Fix up an enormous number of PR nits * Fix a typo; Update the defaults to match #2378 * Tiny nits * Some typos, PR nits * Fix this broken defaults case
2019-09-16 12:57:10 -07:00
file is only provided as a reference of what the default settings are. For more
details on how these two files work, see [Settings
Layering](#settings-layering). To view the default settings file, click on the
"Settings" button while holding the <kbd>Alt</kbd> key.
Details of specific settings can be found [here](../cascadia/SettingsSchema.md).
A general introduction is provided below.
The start of some User docs (#1577) * Start User docs * Fix typos * Addded some more TODO * Update doc/user-docs/index.md Co-Authored-By: Michael Niksa <miniksa@microsoft.com> * Update doc/user-docs/index.md Co-Authored-By: Michael Niksa <miniksa@microsoft.com> * Update doc/user-docs/index.md Co-Authored-By: Michael Niksa <miniksa@microsoft.com> * Update doc/user-docs/index.md Co-Authored-By: Michael Niksa <miniksa@microsoft.com> * Updated from suggestions in the PR * Improve path to profiles.json * Added some details about Json settings * Example Json settings, and a #TODO * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * After review and make colour US. 1. Merged in comments from PR 2. Made colour color :-( 3. Other tidy ups * Added more detais about background images * Remove some TODO comments and minot tidy up * Get rid of TODO 1. Some notes abouet cut and paste -- needs more work 2. Get rid of TODO -- replace with links to issues 3. Add some extra notes about URI for background images
2019-07-09 04:17:19 +10:00
The settings are grouped under four headings:
1. Global: Settings that apply to the whole application e.g. Default profile, initial size etc.
2. Key Bindings: Actually a sub field of the global settings, but worth discussing separately
3. Profiles: A group of settings to be applied to a tab when it is opened using that profile. E.g. shell to use, cursor shape etc.
4. Schemes: Sets of colors for background, text etc. that can be used by profiles
## Global Settings
Add Cascading User + Default Settings (#2515) This PR represents the start of the work on Cascading User + default settings, #754. Cascading settings will be done in two parts: * [ ] Layered Default+User settings (this PR) * [ ] Dynamic Profile Generation (#2603). Until _both_ are done, _neither are going in. The dynamic profiles PR will target this PR when it's ready, but will go in as a separate commit into master. This PR covers adding one primary feature: the settings are now in two separate files: * a static `defaults.json` that ships with the package (the "default settings") * a `profiles.json` with the user's customizations (the "user settings) User settings are _layered_ upon the settings in the defaults settings. ## References Other things that might be related here: * #1378 - This seems like it's definitely fixed. The default keybindings are _much_ cleaner, and without the save-on-load behavior, the user's keybindings will be left in a good state * #1398 - This might have honestly been solved by #2475 ## PR Checklist * [x] Closes #754 * [x] Closes #1378 * [x] Closes #2566 * [x] I work here * [x] Tests added/passed * [x] Requires documentation to be updated - it **ABSOLUTELY DOES** ## Detailed Description of the Pull Request / Additional comments 1. We start by taking all of the `FromJson` functions in Profile, ColorScheme, Globals, etc, and converting them to `LayerJson` methods. These are effectively the same, with the change that instead of building a new object, they are simply layering the values on top of `this` object. 2. Next, we add tests for layering properties like that. 3. Now, we add a `defaults.json` to the package. This is the file the users can refer to as our default settings. 4. We then take that `defaults.json` and stamp it into an auto generated `.h` file, so we can use it's data without having to worry about reading it from disk. 5. We then change the `LoadAll` function in `CascadiaSettings`. Now, the function does two loads - one from the defaults, and then a second load from the `profiles.json` file, layering the settings from each source upon the previous values. 6. If the `profiles.json` file doesn't exist, we'll create it from a hardcoded `userDefaults.json`, which is stamped in similar to how `defaults.json` is. 7. We also add support for _unbinding_ keybindings that might exist in the `defaults.json`, but the user doesn't want to be bound to anything. 8. We add support for _hiding_ a profile, which is useful if a user doesn't want one of the default profiles to appear in the list of profiles. ## TODO: * [x] Still need to make Alt+Click work on the settings button * [x] Need to write some user documentation on how the new settings model works * [x] Fix the pair of tests I broke (re: Duplicate profiles) <hr> * Create profiles by layering them * Update test to layer multiple times on the same profile * Add support for layering an array of profiles, but break a couple tests * Add a defaults.json to the package * Layer colorschemes * Moves tests into individual classes * adds support for layering a colorscheme on top of another * Layer an array of color schemes * oh no, this was missed with #2481 must have committed without staging this change, uh oh. Not like those tests actually work so nbd * Layer keybindings * Read settings from defaults.json + profiles.json, layer appropriately This is like 80% of #754. Needs tests. * Add tests for keybindings * add support to unbind a key with `null` or `"unbound"` or `"garbage"` * Layer or clear optional properties * Add a helper to get an optional variable for a bunch of different types In the end, I think we need to ask _was this worth it_ * Do this with the stretch mode too * Add back in the GUID check for profiles * Add some tests for global settings layering * M A D W I T H P O W E R Add a MsBuild target to auto-generate a header with the defaults.json as a string in the file. That way, we can _always_ load the defaults. Literally impossible to not. * When the user's profile.json doesn't exist, create it from a template * Re-order profiles to match the order set in the user's profiles.json * Add tests for re-ordering profiles to match user ordering * Add support for hiding profiles using `"hidden": true` * Use the hardcoded defaults.json for the exception->"use defaults" case * Somehow I messed up the git submodules? * woo documentation * Fix a Terminal.App.Unit.Tests failure * signed/unsigned is hard * Use Alt+Settings button to open the default settings * Missed a signed/unsigned * Some very preliminary PR feedback * More PR feedback Use the wil helper for the exe path Move jsonutils into their own file kill some dead code * Add templates to these bois * remove some code for generating defaults, reorder defaults.json a tad * Make guid a std::optional * Large block of PR feedback * Remove some dead code * add some comments * tag some todos * stl is love, stl is life * add `-noprofile` * Fix the crash that dustin found * -Encoding ASCII * Set a profile's default scheme to Campbell * Fix the tests I regressed * Update UsingJsonSetting.md to reflect that changes from these PRs * Change how GenerateGuidForProfile works * Make AppKeyBindings do its own serialization * Remove leftover dead code from the previous commit * Fix up an enormous number of PR nits * Fix a typo; Update the defaults to match #2378 * Tiny nits * Some typos, PR nits * Fix this broken defaults case
2019-09-16 12:57:10 -07:00
These settings define startup defaults, and application-wide settings that might
not affect a particular terminal instance.
The start of some User docs (#1577) * Start User docs * Fix typos * Addded some more TODO * Update doc/user-docs/index.md Co-Authored-By: Michael Niksa <miniksa@microsoft.com> * Update doc/user-docs/index.md Co-Authored-By: Michael Niksa <miniksa@microsoft.com> * Update doc/user-docs/index.md Co-Authored-By: Michael Niksa <miniksa@microsoft.com> * Update doc/user-docs/index.md Co-Authored-By: Michael Niksa <miniksa@microsoft.com> * Updated from suggestions in the PR * Improve path to profiles.json * Added some details about Json settings * Example Json settings, and a #TODO * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * After review and make colour US. 1. Merged in comments from PR 2. Made colour color :-( 3. Other tidy ups * Added more detais about background images * Remove some TODO comments and minot tidy up * Get rid of TODO 1. Some notes abouet cut and paste -- needs more work 2. Get rid of TODO -- replace with links to issues 3. Add some extra notes about URI for background images
2019-07-09 04:17:19 +10:00
* Theme
* Title Bar options
* Initial size
Add Cascading User + Default Settings (#2515) This PR represents the start of the work on Cascading User + default settings, #754. Cascading settings will be done in two parts: * [ ] Layered Default+User settings (this PR) * [ ] Dynamic Profile Generation (#2603). Until _both_ are done, _neither are going in. The dynamic profiles PR will target this PR when it's ready, but will go in as a separate commit into master. This PR covers adding one primary feature: the settings are now in two separate files: * a static `defaults.json` that ships with the package (the "default settings") * a `profiles.json` with the user's customizations (the "user settings) User settings are _layered_ upon the settings in the defaults settings. ## References Other things that might be related here: * #1378 - This seems like it's definitely fixed. The default keybindings are _much_ cleaner, and without the save-on-load behavior, the user's keybindings will be left in a good state * #1398 - This might have honestly been solved by #2475 ## PR Checklist * [x] Closes #754 * [x] Closes #1378 * [x] Closes #2566 * [x] I work here * [x] Tests added/passed * [x] Requires documentation to be updated - it **ABSOLUTELY DOES** ## Detailed Description of the Pull Request / Additional comments 1. We start by taking all of the `FromJson` functions in Profile, ColorScheme, Globals, etc, and converting them to `LayerJson` methods. These are effectively the same, with the change that instead of building a new object, they are simply layering the values on top of `this` object. 2. Next, we add tests for layering properties like that. 3. Now, we add a `defaults.json` to the package. This is the file the users can refer to as our default settings. 4. We then take that `defaults.json` and stamp it into an auto generated `.h` file, so we can use it's data without having to worry about reading it from disk. 5. We then change the `LoadAll` function in `CascadiaSettings`. Now, the function does two loads - one from the defaults, and then a second load from the `profiles.json` file, layering the settings from each source upon the previous values. 6. If the `profiles.json` file doesn't exist, we'll create it from a hardcoded `userDefaults.json`, which is stamped in similar to how `defaults.json` is. 7. We also add support for _unbinding_ keybindings that might exist in the `defaults.json`, but the user doesn't want to be bound to anything. 8. We add support for _hiding_ a profile, which is useful if a user doesn't want one of the default profiles to appear in the list of profiles. ## TODO: * [x] Still need to make Alt+Click work on the settings button * [x] Need to write some user documentation on how the new settings model works * [x] Fix the pair of tests I broke (re: Duplicate profiles) <hr> * Create profiles by layering them * Update test to layer multiple times on the same profile * Add support for layering an array of profiles, but break a couple tests * Add a defaults.json to the package * Layer colorschemes * Moves tests into individual classes * adds support for layering a colorscheme on top of another * Layer an array of color schemes * oh no, this was missed with #2481 must have committed without staging this change, uh oh. Not like those tests actually work so nbd * Layer keybindings * Read settings from defaults.json + profiles.json, layer appropriately This is like 80% of #754. Needs tests. * Add tests for keybindings * add support to unbind a key with `null` or `"unbound"` or `"garbage"` * Layer or clear optional properties * Add a helper to get an optional variable for a bunch of different types In the end, I think we need to ask _was this worth it_ * Do this with the stretch mode too * Add back in the GUID check for profiles * Add some tests for global settings layering * M A D W I T H P O W E R Add a MsBuild target to auto-generate a header with the defaults.json as a string in the file. That way, we can _always_ load the defaults. Literally impossible to not. * When the user's profile.json doesn't exist, create it from a template * Re-order profiles to match the order set in the user's profiles.json * Add tests for re-ordering profiles to match user ordering * Add support for hiding profiles using `"hidden": true` * Use the hardcoded defaults.json for the exception->"use defaults" case * Somehow I messed up the git submodules? * woo documentation * Fix a Terminal.App.Unit.Tests failure * signed/unsigned is hard * Use Alt+Settings button to open the default settings * Missed a signed/unsigned * Some very preliminary PR feedback * More PR feedback Use the wil helper for the exe path Move jsonutils into their own file kill some dead code * Add templates to these bois * remove some code for generating defaults, reorder defaults.json a tad * Make guid a std::optional * Large block of PR feedback * Remove some dead code * add some comments * tag some todos * stl is love, stl is life * add `-noprofile` * Fix the crash that dustin found * -Encoding ASCII * Set a profile's default scheme to Campbell * Fix the tests I regressed * Update UsingJsonSetting.md to reflect that changes from these PRs * Change how GenerateGuidForProfile works * Make AppKeyBindings do its own serialization * Remove leftover dead code from the previous commit * Fix up an enormous number of PR nits * Fix a typo; Update the defaults to match #2378 * Tiny nits * Some typos, PR nits * Fix this broken defaults case
2019-09-16 12:57:10 -07:00
* Default profile used when the Windows Terminal is started
The start of some User docs (#1577) * Start User docs * Fix typos * Addded some more TODO * Update doc/user-docs/index.md Co-Authored-By: Michael Niksa <miniksa@microsoft.com> * Update doc/user-docs/index.md Co-Authored-By: Michael Niksa <miniksa@microsoft.com> * Update doc/user-docs/index.md Co-Authored-By: Michael Niksa <miniksa@microsoft.com> * Update doc/user-docs/index.md Co-Authored-By: Michael Niksa <miniksa@microsoft.com> * Updated from suggestions in the PR * Improve path to profiles.json * Added some details about Json settings * Example Json settings, and a #TODO * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * After review and make colour US. 1. Merged in comments from PR 2. Made colour color :-( 3. Other tidy ups * Added more detais about background images * Remove some TODO comments and minot tidy up * Get rid of TODO 1. Some notes abouet cut and paste -- needs more work 2. Get rid of TODO -- replace with links to issues 3. Add some extra notes about URI for background images
2019-07-09 04:17:19 +10:00
Example settings include
```json
"defaultProfile" : "{58ad8b0c-3ef8-5f4d-bc6f-13e4c00f2530}",
"initialCols" : 120,
"initialRows" : 50,
"requestedTheme" : "system",
Add Cascading User + Default Settings (#2515) This PR represents the start of the work on Cascading User + default settings, #754. Cascading settings will be done in two parts: * [ ] Layered Default+User settings (this PR) * [ ] Dynamic Profile Generation (#2603). Until _both_ are done, _neither are going in. The dynamic profiles PR will target this PR when it's ready, but will go in as a separate commit into master. This PR covers adding one primary feature: the settings are now in two separate files: * a static `defaults.json` that ships with the package (the "default settings") * a `profiles.json` with the user's customizations (the "user settings) User settings are _layered_ upon the settings in the defaults settings. ## References Other things that might be related here: * #1378 - This seems like it's definitely fixed. The default keybindings are _much_ cleaner, and without the save-on-load behavior, the user's keybindings will be left in a good state * #1398 - This might have honestly been solved by #2475 ## PR Checklist * [x] Closes #754 * [x] Closes #1378 * [x] Closes #2566 * [x] I work here * [x] Tests added/passed * [x] Requires documentation to be updated - it **ABSOLUTELY DOES** ## Detailed Description of the Pull Request / Additional comments 1. We start by taking all of the `FromJson` functions in Profile, ColorScheme, Globals, etc, and converting them to `LayerJson` methods. These are effectively the same, with the change that instead of building a new object, they are simply layering the values on top of `this` object. 2. Next, we add tests for layering properties like that. 3. Now, we add a `defaults.json` to the package. This is the file the users can refer to as our default settings. 4. We then take that `defaults.json` and stamp it into an auto generated `.h` file, so we can use it's data without having to worry about reading it from disk. 5. We then change the `LoadAll` function in `CascadiaSettings`. Now, the function does two loads - one from the defaults, and then a second load from the `profiles.json` file, layering the settings from each source upon the previous values. 6. If the `profiles.json` file doesn't exist, we'll create it from a hardcoded `userDefaults.json`, which is stamped in similar to how `defaults.json` is. 7. We also add support for _unbinding_ keybindings that might exist in the `defaults.json`, but the user doesn't want to be bound to anything. 8. We add support for _hiding_ a profile, which is useful if a user doesn't want one of the default profiles to appear in the list of profiles. ## TODO: * [x] Still need to make Alt+Click work on the settings button * [x] Need to write some user documentation on how the new settings model works * [x] Fix the pair of tests I broke (re: Duplicate profiles) <hr> * Create profiles by layering them * Update test to layer multiple times on the same profile * Add support for layering an array of profiles, but break a couple tests * Add a defaults.json to the package * Layer colorschemes * Moves tests into individual classes * adds support for layering a colorscheme on top of another * Layer an array of color schemes * oh no, this was missed with #2481 must have committed without staging this change, uh oh. Not like those tests actually work so nbd * Layer keybindings * Read settings from defaults.json + profiles.json, layer appropriately This is like 80% of #754. Needs tests. * Add tests for keybindings * add support to unbind a key with `null` or `"unbound"` or `"garbage"` * Layer or clear optional properties * Add a helper to get an optional variable for a bunch of different types In the end, I think we need to ask _was this worth it_ * Do this with the stretch mode too * Add back in the GUID check for profiles * Add some tests for global settings layering * M A D W I T H P O W E R Add a MsBuild target to auto-generate a header with the defaults.json as a string in the file. That way, we can _always_ load the defaults. Literally impossible to not. * When the user's profile.json doesn't exist, create it from a template * Re-order profiles to match the order set in the user's profiles.json * Add tests for re-ordering profiles to match user ordering * Add support for hiding profiles using `"hidden": true` * Use the hardcoded defaults.json for the exception->"use defaults" case * Somehow I messed up the git submodules? * woo documentation * Fix a Terminal.App.Unit.Tests failure * signed/unsigned is hard * Use Alt+Settings button to open the default settings * Missed a signed/unsigned * Some very preliminary PR feedback * More PR feedback Use the wil helper for the exe path Move jsonutils into their own file kill some dead code * Add templates to these bois * remove some code for generating defaults, reorder defaults.json a tad * Make guid a std::optional * Large block of PR feedback * Remove some dead code * add some comments * tag some todos * stl is love, stl is life * add `-noprofile` * Fix the crash that dustin found * -Encoding ASCII * Set a profile's default scheme to Campbell * Fix the tests I regressed * Update UsingJsonSetting.md to reflect that changes from these PRs * Change how GenerateGuidForProfile works * Make AppKeyBindings do its own serialization * Remove leftover dead code from the previous commit * Fix up an enormous number of PR nits * Fix a typo; Update the defaults to match #2378 * Tiny nits * Some typos, PR nits * Fix this broken defaults case
2019-09-16 12:57:10 -07:00
"keybindings" : []
The start of some User docs (#1577) * Start User docs * Fix typos * Addded some more TODO * Update doc/user-docs/index.md Co-Authored-By: Michael Niksa <miniksa@microsoft.com> * Update doc/user-docs/index.md Co-Authored-By: Michael Niksa <miniksa@microsoft.com> * Update doc/user-docs/index.md Co-Authored-By: Michael Niksa <miniksa@microsoft.com> * Update doc/user-docs/index.md Co-Authored-By: Michael Niksa <miniksa@microsoft.com> * Updated from suggestions in the PR * Improve path to profiles.json * Added some details about Json settings * Example Json settings, and a #TODO * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * After review and make colour US. 1. Merged in comments from PR 2. Made colour color :-( 3. Other tidy ups * Added more detais about background images * Remove some TODO comments and minot tidy up * Get rid of TODO 1. Some notes abouet cut and paste -- needs more work 2. Get rid of TODO -- replace with links to issues 3. Add some extra notes about URI for background images
2019-07-09 04:17:19 +10:00
...
```
These global properties can exist either in the root json object, or in an
Add Cascading User + Default Settings (#2515) This PR represents the start of the work on Cascading User + default settings, #754. Cascading settings will be done in two parts: * [ ] Layered Default+User settings (this PR) * [ ] Dynamic Profile Generation (#2603). Until _both_ are done, _neither are going in. The dynamic profiles PR will target this PR when it's ready, but will go in as a separate commit into master. This PR covers adding one primary feature: the settings are now in two separate files: * a static `defaults.json` that ships with the package (the "default settings") * a `profiles.json` with the user's customizations (the "user settings) User settings are _layered_ upon the settings in the defaults settings. ## References Other things that might be related here: * #1378 - This seems like it's definitely fixed. The default keybindings are _much_ cleaner, and without the save-on-load behavior, the user's keybindings will be left in a good state * #1398 - This might have honestly been solved by #2475 ## PR Checklist * [x] Closes #754 * [x] Closes #1378 * [x] Closes #2566 * [x] I work here * [x] Tests added/passed * [x] Requires documentation to be updated - it **ABSOLUTELY DOES** ## Detailed Description of the Pull Request / Additional comments 1. We start by taking all of the `FromJson` functions in Profile, ColorScheme, Globals, etc, and converting them to `LayerJson` methods. These are effectively the same, with the change that instead of building a new object, they are simply layering the values on top of `this` object. 2. Next, we add tests for layering properties like that. 3. Now, we add a `defaults.json` to the package. This is the file the users can refer to as our default settings. 4. We then take that `defaults.json` and stamp it into an auto generated `.h` file, so we can use it's data without having to worry about reading it from disk. 5. We then change the `LoadAll` function in `CascadiaSettings`. Now, the function does two loads - one from the defaults, and then a second load from the `profiles.json` file, layering the settings from each source upon the previous values. 6. If the `profiles.json` file doesn't exist, we'll create it from a hardcoded `userDefaults.json`, which is stamped in similar to how `defaults.json` is. 7. We also add support for _unbinding_ keybindings that might exist in the `defaults.json`, but the user doesn't want to be bound to anything. 8. We add support for _hiding_ a profile, which is useful if a user doesn't want one of the default profiles to appear in the list of profiles. ## TODO: * [x] Still need to make Alt+Click work on the settings button * [x] Need to write some user documentation on how the new settings model works * [x] Fix the pair of tests I broke (re: Duplicate profiles) <hr> * Create profiles by layering them * Update test to layer multiple times on the same profile * Add support for layering an array of profiles, but break a couple tests * Add a defaults.json to the package * Layer colorschemes * Moves tests into individual classes * adds support for layering a colorscheme on top of another * Layer an array of color schemes * oh no, this was missed with #2481 must have committed without staging this change, uh oh. Not like those tests actually work so nbd * Layer keybindings * Read settings from defaults.json + profiles.json, layer appropriately This is like 80% of #754. Needs tests. * Add tests for keybindings * add support to unbind a key with `null` or `"unbound"` or `"garbage"` * Layer or clear optional properties * Add a helper to get an optional variable for a bunch of different types In the end, I think we need to ask _was this worth it_ * Do this with the stretch mode too * Add back in the GUID check for profiles * Add some tests for global settings layering * M A D W I T H P O W E R Add a MsBuild target to auto-generate a header with the defaults.json as a string in the file. That way, we can _always_ load the defaults. Literally impossible to not. * When the user's profile.json doesn't exist, create it from a template * Re-order profiles to match the order set in the user's profiles.json * Add tests for re-ordering profiles to match user ordering * Add support for hiding profiles using `"hidden": true` * Use the hardcoded defaults.json for the exception->"use defaults" case * Somehow I messed up the git submodules? * woo documentation * Fix a Terminal.App.Unit.Tests failure * signed/unsigned is hard * Use Alt+Settings button to open the default settings * Missed a signed/unsigned * Some very preliminary PR feedback * More PR feedback Use the wil helper for the exe path Move jsonutils into their own file kill some dead code * Add templates to these bois * remove some code for generating defaults, reorder defaults.json a tad * Make guid a std::optional * Large block of PR feedback * Remove some dead code * add some comments * tag some todos * stl is love, stl is life * add `-noprofile` * Fix the crash that dustin found * -Encoding ASCII * Set a profile's default scheme to Campbell * Fix the tests I regressed * Update UsingJsonSetting.md to reflect that changes from these PRs * Change how GenerateGuidForProfile works * Make AppKeyBindings do its own serialization * Remove leftover dead code from the previous commit * Fix up an enormous number of PR nits * Fix a typo; Update the defaults to match #2378 * Tiny nits * Some typos, PR nits * Fix this broken defaults case
2019-09-16 12:57:10 -07:00
object under a root property `"globals"`.
The start of some User docs (#1577) * Start User docs * Fix typos * Addded some more TODO * Update doc/user-docs/index.md Co-Authored-By: Michael Niksa <miniksa@microsoft.com> * Update doc/user-docs/index.md Co-Authored-By: Michael Niksa <miniksa@microsoft.com> * Update doc/user-docs/index.md Co-Authored-By: Michael Niksa <miniksa@microsoft.com> * Update doc/user-docs/index.md Co-Authored-By: Michael Niksa <miniksa@microsoft.com> * Updated from suggestions in the PR * Improve path to profiles.json * Added some details about Json settings * Example Json settings, and a #TODO * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * After review and make colour US. 1. Merged in comments from PR 2. Made colour color :-( 3. Other tidy ups * Added more detais about background images * Remove some TODO comments and minot tidy up * Get rid of TODO 1. Some notes abouet cut and paste -- needs more work 2. Get rid of TODO -- replace with links to issues 3. Add some extra notes about URI for background images
2019-07-09 04:17:19 +10:00
## Key Bindings
This is an array of key chords and shortcuts to invoke various commands.
Each command can have more than one key binding.
> 👉 **Note**: Key bindings is a subfield of the global settings and
> key bindings apply to all profiles in the same manner.
The start of some User docs (#1577) * Start User docs * Fix typos * Addded some more TODO * Update doc/user-docs/index.md Co-Authored-By: Michael Niksa <miniksa@microsoft.com> * Update doc/user-docs/index.md Co-Authored-By: Michael Niksa <miniksa@microsoft.com> * Update doc/user-docs/index.md Co-Authored-By: Michael Niksa <miniksa@microsoft.com> * Update doc/user-docs/index.md Co-Authored-By: Michael Niksa <miniksa@microsoft.com> * Updated from suggestions in the PR * Improve path to profiles.json * Added some details about Json settings * Example Json settings, and a #TODO * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * After review and make colour US. 1. Merged in comments from PR 2. Made colour color :-( 3. Other tidy ups * Added more detais about background images * Remove some TODO comments and minot tidy up * Get rid of TODO 1. Some notes abouet cut and paste -- needs more work 2. Get rid of TODO -- replace with links to issues 3. Add some extra notes about URI for background images
2019-07-09 04:17:19 +10:00
Add Cascading User + Default Settings (#2515) This PR represents the start of the work on Cascading User + default settings, #754. Cascading settings will be done in two parts: * [ ] Layered Default+User settings (this PR) * [ ] Dynamic Profile Generation (#2603). Until _both_ are done, _neither are going in. The dynamic profiles PR will target this PR when it's ready, but will go in as a separate commit into master. This PR covers adding one primary feature: the settings are now in two separate files: * a static `defaults.json` that ships with the package (the "default settings") * a `profiles.json` with the user's customizations (the "user settings) User settings are _layered_ upon the settings in the defaults settings. ## References Other things that might be related here: * #1378 - This seems like it's definitely fixed. The default keybindings are _much_ cleaner, and without the save-on-load behavior, the user's keybindings will be left in a good state * #1398 - This might have honestly been solved by #2475 ## PR Checklist * [x] Closes #754 * [x] Closes #1378 * [x] Closes #2566 * [x] I work here * [x] Tests added/passed * [x] Requires documentation to be updated - it **ABSOLUTELY DOES** ## Detailed Description of the Pull Request / Additional comments 1. We start by taking all of the `FromJson` functions in Profile, ColorScheme, Globals, etc, and converting them to `LayerJson` methods. These are effectively the same, with the change that instead of building a new object, they are simply layering the values on top of `this` object. 2. Next, we add tests for layering properties like that. 3. Now, we add a `defaults.json` to the package. This is the file the users can refer to as our default settings. 4. We then take that `defaults.json` and stamp it into an auto generated `.h` file, so we can use it's data without having to worry about reading it from disk. 5. We then change the `LoadAll` function in `CascadiaSettings`. Now, the function does two loads - one from the defaults, and then a second load from the `profiles.json` file, layering the settings from each source upon the previous values. 6. If the `profiles.json` file doesn't exist, we'll create it from a hardcoded `userDefaults.json`, which is stamped in similar to how `defaults.json` is. 7. We also add support for _unbinding_ keybindings that might exist in the `defaults.json`, but the user doesn't want to be bound to anything. 8. We add support for _hiding_ a profile, which is useful if a user doesn't want one of the default profiles to appear in the list of profiles. ## TODO: * [x] Still need to make Alt+Click work on the settings button * [x] Need to write some user documentation on how the new settings model works * [x] Fix the pair of tests I broke (re: Duplicate profiles) <hr> * Create profiles by layering them * Update test to layer multiple times on the same profile * Add support for layering an array of profiles, but break a couple tests * Add a defaults.json to the package * Layer colorschemes * Moves tests into individual classes * adds support for layering a colorscheme on top of another * Layer an array of color schemes * oh no, this was missed with #2481 must have committed without staging this change, uh oh. Not like those tests actually work so nbd * Layer keybindings * Read settings from defaults.json + profiles.json, layer appropriately This is like 80% of #754. Needs tests. * Add tests for keybindings * add support to unbind a key with `null` or `"unbound"` or `"garbage"` * Layer or clear optional properties * Add a helper to get an optional variable for a bunch of different types In the end, I think we need to ask _was this worth it_ * Do this with the stretch mode too * Add back in the GUID check for profiles * Add some tests for global settings layering * M A D W I T H P O W E R Add a MsBuild target to auto-generate a header with the defaults.json as a string in the file. That way, we can _always_ load the defaults. Literally impossible to not. * When the user's profile.json doesn't exist, create it from a template * Re-order profiles to match the order set in the user's profiles.json * Add tests for re-ordering profiles to match user ordering * Add support for hiding profiles using `"hidden": true` * Use the hardcoded defaults.json for the exception->"use defaults" case * Somehow I messed up the git submodules? * woo documentation * Fix a Terminal.App.Unit.Tests failure * signed/unsigned is hard * Use Alt+Settings button to open the default settings * Missed a signed/unsigned * Some very preliminary PR feedback * More PR feedback Use the wil helper for the exe path Move jsonutils into their own file kill some dead code * Add templates to these bois * remove some code for generating defaults, reorder defaults.json a tad * Make guid a std::optional * Large block of PR feedback * Remove some dead code * add some comments * tag some todos * stl is love, stl is life * add `-noprofile` * Fix the crash that dustin found * -Encoding ASCII * Set a profile's default scheme to Campbell * Fix the tests I regressed * Update UsingJsonSetting.md to reflect that changes from these PRs * Change how GenerateGuidForProfile works * Make AppKeyBindings do its own serialization * Remove leftover dead code from the previous commit * Fix up an enormous number of PR nits * Fix a typo; Update the defaults to match #2378 * Tiny nits * Some typos, PR nits * Fix this broken defaults case
2019-09-16 12:57:10 -07:00
For example, here's a sample of the default keybindings:
```json
{
"keybindings":
[
{ "command": "closePane", "keys": ["ctrl+shift+w"] },
{ "command": "copy", "keys": ["ctrl+shift+c"] },
{ "command": "newTab", "keys": ["ctrl+shift+t"] },
// etc.
]
}
```
You can also use a single key chord string as the value of `"keys"`.
It will be treated as a chord of length one.
This will allow you to simplify the above snippet as follows:
Add Cascading User + Default Settings (#2515) This PR represents the start of the work on Cascading User + default settings, #754. Cascading settings will be done in two parts: * [ ] Layered Default+User settings (this PR) * [ ] Dynamic Profile Generation (#2603). Until _both_ are done, _neither are going in. The dynamic profiles PR will target this PR when it's ready, but will go in as a separate commit into master. This PR covers adding one primary feature: the settings are now in two separate files: * a static `defaults.json` that ships with the package (the "default settings") * a `profiles.json` with the user's customizations (the "user settings) User settings are _layered_ upon the settings in the defaults settings. ## References Other things that might be related here: * #1378 - This seems like it's definitely fixed. The default keybindings are _much_ cleaner, and without the save-on-load behavior, the user's keybindings will be left in a good state * #1398 - This might have honestly been solved by #2475 ## PR Checklist * [x] Closes #754 * [x] Closes #1378 * [x] Closes #2566 * [x] I work here * [x] Tests added/passed * [x] Requires documentation to be updated - it **ABSOLUTELY DOES** ## Detailed Description of the Pull Request / Additional comments 1. We start by taking all of the `FromJson` functions in Profile, ColorScheme, Globals, etc, and converting them to `LayerJson` methods. These are effectively the same, with the change that instead of building a new object, they are simply layering the values on top of `this` object. 2. Next, we add tests for layering properties like that. 3. Now, we add a `defaults.json` to the package. This is the file the users can refer to as our default settings. 4. We then take that `defaults.json` and stamp it into an auto generated `.h` file, so we can use it's data without having to worry about reading it from disk. 5. We then change the `LoadAll` function in `CascadiaSettings`. Now, the function does two loads - one from the defaults, and then a second load from the `profiles.json` file, layering the settings from each source upon the previous values. 6. If the `profiles.json` file doesn't exist, we'll create it from a hardcoded `userDefaults.json`, which is stamped in similar to how `defaults.json` is. 7. We also add support for _unbinding_ keybindings that might exist in the `defaults.json`, but the user doesn't want to be bound to anything. 8. We add support for _hiding_ a profile, which is useful if a user doesn't want one of the default profiles to appear in the list of profiles. ## TODO: * [x] Still need to make Alt+Click work on the settings button * [x] Need to write some user documentation on how the new settings model works * [x] Fix the pair of tests I broke (re: Duplicate profiles) <hr> * Create profiles by layering them * Update test to layer multiple times on the same profile * Add support for layering an array of profiles, but break a couple tests * Add a defaults.json to the package * Layer colorschemes * Moves tests into individual classes * adds support for layering a colorscheme on top of another * Layer an array of color schemes * oh no, this was missed with #2481 must have committed without staging this change, uh oh. Not like those tests actually work so nbd * Layer keybindings * Read settings from defaults.json + profiles.json, layer appropriately This is like 80% of #754. Needs tests. * Add tests for keybindings * add support to unbind a key with `null` or `"unbound"` or `"garbage"` * Layer or clear optional properties * Add a helper to get an optional variable for a bunch of different types In the end, I think we need to ask _was this worth it_ * Do this with the stretch mode too * Add back in the GUID check for profiles * Add some tests for global settings layering * M A D W I T H P O W E R Add a MsBuild target to auto-generate a header with the defaults.json as a string in the file. That way, we can _always_ load the defaults. Literally impossible to not. * When the user's profile.json doesn't exist, create it from a template * Re-order profiles to match the order set in the user's profiles.json * Add tests for re-ordering profiles to match user ordering * Add support for hiding profiles using `"hidden": true` * Use the hardcoded defaults.json for the exception->"use defaults" case * Somehow I messed up the git submodules? * woo documentation * Fix a Terminal.App.Unit.Tests failure * signed/unsigned is hard * Use Alt+Settings button to open the default settings * Missed a signed/unsigned * Some very preliminary PR feedback * More PR feedback Use the wil helper for the exe path Move jsonutils into their own file kill some dead code * Add templates to these bois * remove some code for generating defaults, reorder defaults.json a tad * Make guid a std::optional * Large block of PR feedback * Remove some dead code * add some comments * tag some todos * stl is love, stl is life * add `-noprofile` * Fix the crash that dustin found * -Encoding ASCII * Set a profile's default scheme to Campbell * Fix the tests I regressed * Update UsingJsonSetting.md to reflect that changes from these PRs * Change how GenerateGuidForProfile works * Make AppKeyBindings do its own serialization * Remove leftover dead code from the previous commit * Fix up an enormous number of PR nits * Fix a typo; Update the defaults to match #2378 * Tiny nits * Some typos, PR nits * Fix this broken defaults case
2019-09-16 12:57:10 -07:00
```json
{
"keybindings":
[
{ "command": "closePane", "keys": "ctrl+shift+w" },
{ "command": "copy", "keys": "ctrl+shift+c" },
{ "command": "newTab", "keys": "ctrl+shift+t" },
// etc.
]
}
Add Cascading User + Default Settings (#2515) This PR represents the start of the work on Cascading User + default settings, #754. Cascading settings will be done in two parts: * [ ] Layered Default+User settings (this PR) * [ ] Dynamic Profile Generation (#2603). Until _both_ are done, _neither are going in. The dynamic profiles PR will target this PR when it's ready, but will go in as a separate commit into master. This PR covers adding one primary feature: the settings are now in two separate files: * a static `defaults.json` that ships with the package (the "default settings") * a `profiles.json` with the user's customizations (the "user settings) User settings are _layered_ upon the settings in the defaults settings. ## References Other things that might be related here: * #1378 - This seems like it's definitely fixed. The default keybindings are _much_ cleaner, and without the save-on-load behavior, the user's keybindings will be left in a good state * #1398 - This might have honestly been solved by #2475 ## PR Checklist * [x] Closes #754 * [x] Closes #1378 * [x] Closes #2566 * [x] I work here * [x] Tests added/passed * [x] Requires documentation to be updated - it **ABSOLUTELY DOES** ## Detailed Description of the Pull Request / Additional comments 1. We start by taking all of the `FromJson` functions in Profile, ColorScheme, Globals, etc, and converting them to `LayerJson` methods. These are effectively the same, with the change that instead of building a new object, they are simply layering the values on top of `this` object. 2. Next, we add tests for layering properties like that. 3. Now, we add a `defaults.json` to the package. This is the file the users can refer to as our default settings. 4. We then take that `defaults.json` and stamp it into an auto generated `.h` file, so we can use it's data without having to worry about reading it from disk. 5. We then change the `LoadAll` function in `CascadiaSettings`. Now, the function does two loads - one from the defaults, and then a second load from the `profiles.json` file, layering the settings from each source upon the previous values. 6. If the `profiles.json` file doesn't exist, we'll create it from a hardcoded `userDefaults.json`, which is stamped in similar to how `defaults.json` is. 7. We also add support for _unbinding_ keybindings that might exist in the `defaults.json`, but the user doesn't want to be bound to anything. 8. We add support for _hiding_ a profile, which is useful if a user doesn't want one of the default profiles to appear in the list of profiles. ## TODO: * [x] Still need to make Alt+Click work on the settings button * [x] Need to write some user documentation on how the new settings model works * [x] Fix the pair of tests I broke (re: Duplicate profiles) <hr> * Create profiles by layering them * Update test to layer multiple times on the same profile * Add support for layering an array of profiles, but break a couple tests * Add a defaults.json to the package * Layer colorschemes * Moves tests into individual classes * adds support for layering a colorscheme on top of another * Layer an array of color schemes * oh no, this was missed with #2481 must have committed without staging this change, uh oh. Not like those tests actually work so nbd * Layer keybindings * Read settings from defaults.json + profiles.json, layer appropriately This is like 80% of #754. Needs tests. * Add tests for keybindings * add support to unbind a key with `null` or `"unbound"` or `"garbage"` * Layer or clear optional properties * Add a helper to get an optional variable for a bunch of different types In the end, I think we need to ask _was this worth it_ * Do this with the stretch mode too * Add back in the GUID check for profiles * Add some tests for global settings layering * M A D W I T H P O W E R Add a MsBuild target to auto-generate a header with the defaults.json as a string in the file. That way, we can _always_ load the defaults. Literally impossible to not. * When the user's profile.json doesn't exist, create it from a template * Re-order profiles to match the order set in the user's profiles.json * Add tests for re-ordering profiles to match user ordering * Add support for hiding profiles using `"hidden": true` * Use the hardcoded defaults.json for the exception->"use defaults" case * Somehow I messed up the git submodules? * woo documentation * Fix a Terminal.App.Unit.Tests failure * signed/unsigned is hard * Use Alt+Settings button to open the default settings * Missed a signed/unsigned * Some very preliminary PR feedback * More PR feedback Use the wil helper for the exe path Move jsonutils into their own file kill some dead code * Add templates to these bois * remove some code for generating defaults, reorder defaults.json a tad * Make guid a std::optional * Large block of PR feedback * Remove some dead code * add some comments * tag some todos * stl is love, stl is life * add `-noprofile` * Fix the crash that dustin found * -Encoding ASCII * Set a profile's default scheme to Campbell * Fix the tests I regressed * Update UsingJsonSetting.md to reflect that changes from these PRs * Change how GenerateGuidForProfile works * Make AppKeyBindings do its own serialization * Remove leftover dead code from the previous commit * Fix up an enormous number of PR nits * Fix a typo; Update the defaults to match #2378 * Tiny nits * Some typos, PR nits * Fix this broken defaults case
2019-09-16 12:57:10 -07:00
```
### Unbinding keys
If you ever come across a key binding that you're unhappy with, it's possible to
easily change the keybindings. For example, vim uses <kbd>Ctrl+^</kbd> as a
binding for "switch to previous buffer", which conflicts with the Terminal's
default keybinding for "open a new tab with the sixth profile". If you'd like to
unbind that keybinding, and allow the keystroke to fall through to vim, you can
add the following to your keybindings:
```json
{
"command" : null, "keys" : ["ctrl+shift+6"]
},
```
This will _unbind_ <kbd>Ctrl+Shift+6</kbd>, allowing vim to use the keystroke
instead of the terminal.
### Binding multiple keys
You can have multiple key chords bound to the same action. To do this, simply
add multiple bindings for the same action. For example:
```json
"keybindings" :
[
{ "command": "copy", "keys": "ctrl+shift+c" },
{ "command": "copy", "keys": "ctrl+c" },
{ "command": "copy", "keys": "enter" }
]
```
In this snippet, all three of <kbd>ctrl+shift+c</kbd>, <kbd>ctrl+c</kbd> and <kbd>enter</kbd> are bound to `copy`.
The start of some User docs (#1577) * Start User docs * Fix typos * Addded some more TODO * Update doc/user-docs/index.md Co-Authored-By: Michael Niksa <miniksa@microsoft.com> * Update doc/user-docs/index.md Co-Authored-By: Michael Niksa <miniksa@microsoft.com> * Update doc/user-docs/index.md Co-Authored-By: Michael Niksa <miniksa@microsoft.com> * Update doc/user-docs/index.md Co-Authored-By: Michael Niksa <miniksa@microsoft.com> * Updated from suggestions in the PR * Improve path to profiles.json * Added some details about Json settings * Example Json settings, and a #TODO * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * After review and make colour US. 1. Merged in comments from PR 2. Made colour color :-( 3. Other tidy ups * Added more detais about background images * Remove some TODO comments and minot tidy up * Get rid of TODO 1. Some notes abouet cut and paste -- needs more work 2. Get rid of TODO -- replace with links to issues 3. Add some extra notes about URI for background images
2019-07-09 04:17:19 +10:00
## Profiles
Add Cascading User + Default Settings (#2515) This PR represents the start of the work on Cascading User + default settings, #754. Cascading settings will be done in two parts: * [ ] Layered Default+User settings (this PR) * [ ] Dynamic Profile Generation (#2603). Until _both_ are done, _neither are going in. The dynamic profiles PR will target this PR when it's ready, but will go in as a separate commit into master. This PR covers adding one primary feature: the settings are now in two separate files: * a static `defaults.json` that ships with the package (the "default settings") * a `profiles.json` with the user's customizations (the "user settings) User settings are _layered_ upon the settings in the defaults settings. ## References Other things that might be related here: * #1378 - This seems like it's definitely fixed. The default keybindings are _much_ cleaner, and without the save-on-load behavior, the user's keybindings will be left in a good state * #1398 - This might have honestly been solved by #2475 ## PR Checklist * [x] Closes #754 * [x] Closes #1378 * [x] Closes #2566 * [x] I work here * [x] Tests added/passed * [x] Requires documentation to be updated - it **ABSOLUTELY DOES** ## Detailed Description of the Pull Request / Additional comments 1. We start by taking all of the `FromJson` functions in Profile, ColorScheme, Globals, etc, and converting them to `LayerJson` methods. These are effectively the same, with the change that instead of building a new object, they are simply layering the values on top of `this` object. 2. Next, we add tests for layering properties like that. 3. Now, we add a `defaults.json` to the package. This is the file the users can refer to as our default settings. 4. We then take that `defaults.json` and stamp it into an auto generated `.h` file, so we can use it's data without having to worry about reading it from disk. 5. We then change the `LoadAll` function in `CascadiaSettings`. Now, the function does two loads - one from the defaults, and then a second load from the `profiles.json` file, layering the settings from each source upon the previous values. 6. If the `profiles.json` file doesn't exist, we'll create it from a hardcoded `userDefaults.json`, which is stamped in similar to how `defaults.json` is. 7. We also add support for _unbinding_ keybindings that might exist in the `defaults.json`, but the user doesn't want to be bound to anything. 8. We add support for _hiding_ a profile, which is useful if a user doesn't want one of the default profiles to appear in the list of profiles. ## TODO: * [x] Still need to make Alt+Click work on the settings button * [x] Need to write some user documentation on how the new settings model works * [x] Fix the pair of tests I broke (re: Duplicate profiles) <hr> * Create profiles by layering them * Update test to layer multiple times on the same profile * Add support for layering an array of profiles, but break a couple tests * Add a defaults.json to the package * Layer colorschemes * Moves tests into individual classes * adds support for layering a colorscheme on top of another * Layer an array of color schemes * oh no, this was missed with #2481 must have committed without staging this change, uh oh. Not like those tests actually work so nbd * Layer keybindings * Read settings from defaults.json + profiles.json, layer appropriately This is like 80% of #754. Needs tests. * Add tests for keybindings * add support to unbind a key with `null` or `"unbound"` or `"garbage"` * Layer or clear optional properties * Add a helper to get an optional variable for a bunch of different types In the end, I think we need to ask _was this worth it_ * Do this with the stretch mode too * Add back in the GUID check for profiles * Add some tests for global settings layering * M A D W I T H P O W E R Add a MsBuild target to auto-generate a header with the defaults.json as a string in the file. That way, we can _always_ load the defaults. Literally impossible to not. * When the user's profile.json doesn't exist, create it from a template * Re-order profiles to match the order set in the user's profiles.json * Add tests for re-ordering profiles to match user ordering * Add support for hiding profiles using `"hidden": true` * Use the hardcoded defaults.json for the exception->"use defaults" case * Somehow I messed up the git submodules? * woo documentation * Fix a Terminal.App.Unit.Tests failure * signed/unsigned is hard * Use Alt+Settings button to open the default settings * Missed a signed/unsigned * Some very preliminary PR feedback * More PR feedback Use the wil helper for the exe path Move jsonutils into their own file kill some dead code * Add templates to these bois * remove some code for generating defaults, reorder defaults.json a tad * Make guid a std::optional * Large block of PR feedback * Remove some dead code * add some comments * tag some todos * stl is love, stl is life * add `-noprofile` * Fix the crash that dustin found * -Encoding ASCII * Set a profile's default scheme to Campbell * Fix the tests I regressed * Update UsingJsonSetting.md to reflect that changes from these PRs * Change how GenerateGuidForProfile works * Make AppKeyBindings do its own serialization * Remove leftover dead code from the previous commit * Fix up an enormous number of PR nits * Fix a typo; Update the defaults to match #2378 * Tiny nits * Some typos, PR nits * Fix this broken defaults case
2019-09-16 12:57:10 -07:00
A profile contains the settings applied when a new WT tab is opened. Each
profile is identified by a GUID and contains a number of other fields.
> 👉 **Note**: The `guid` property is the unique identifier for a profile. If
> multiple profiles all have the same `guid` value, you may see unexpected
> behavior.
The start of some User docs (#1577) * Start User docs * Fix typos * Addded some more TODO * Update doc/user-docs/index.md Co-Authored-By: Michael Niksa <miniksa@microsoft.com> * Update doc/user-docs/index.md Co-Authored-By: Michael Niksa <miniksa@microsoft.com> * Update doc/user-docs/index.md Co-Authored-By: Michael Niksa <miniksa@microsoft.com> * Update doc/user-docs/index.md Co-Authored-By: Michael Niksa <miniksa@microsoft.com> * Updated from suggestions in the PR * Improve path to profiles.json * Added some details about Json settings * Example Json settings, and a #TODO * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * After review and make colour US. 1. Merged in comments from PR 2. Made colour color :-( 3. Other tidy ups * Added more detais about background images * Remove some TODO comments and minot tidy up * Get rid of TODO 1. Some notes abouet cut and paste -- needs more work 2. Get rid of TODO -- replace with links to issues 3. Add some extra notes about URI for background images
2019-07-09 04:17:19 +10:00
* Which command to execute on startup - this can include arguments.
* Starting directory
* Which color scheme to use (see Schemes below)
* Font face and size
* Various settings to control appearance. E.g. Opacity, icon, cursor appearance, display name etc.
* Other behavioral settings. E.g. Close on exit, snap on input, .....
The start of some User docs (#1577) * Start User docs * Fix typos * Addded some more TODO * Update doc/user-docs/index.md Co-Authored-By: Michael Niksa <miniksa@microsoft.com> * Update doc/user-docs/index.md Co-Authored-By: Michael Niksa <miniksa@microsoft.com> * Update doc/user-docs/index.md Co-Authored-By: Michael Niksa <miniksa@microsoft.com> * Update doc/user-docs/index.md Co-Authored-By: Michael Niksa <miniksa@microsoft.com> * Updated from suggestions in the PR * Improve path to profiles.json * Added some details about Json settings * Example Json settings, and a #TODO * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * After review and make colour US. 1. Merged in comments from PR 2. Made colour color :-( 3. Other tidy ups * Added more detais about background images * Remove some TODO comments and minot tidy up * Get rid of TODO 1. Some notes abouet cut and paste -- needs more work 2. Get rid of TODO -- replace with links to issues 3. Add some extra notes about URI for background images
2019-07-09 04:17:19 +10:00
Example settings include
```json
"closeOnExit" : true,
"colorScheme" : "Campbell",
"commandline" : "wsl.exe -d Debian",
"cursorColor" : "#FFFFFF",
"cursorShape" : "bar",
"fontFace" : "Hack",
"fontSize" : 9,
"guid" : "{58ad8b0c-3ef8-5f4d-bc6f-13e4c00f2530}",
"name" : "Debian",
"startingDirectory" : "%USERPROFILE%\\wslhome"
The start of some User docs (#1577) * Start User docs * Fix typos * Addded some more TODO * Update doc/user-docs/index.md Co-Authored-By: Michael Niksa <miniksa@microsoft.com> * Update doc/user-docs/index.md Co-Authored-By: Michael Niksa <miniksa@microsoft.com> * Update doc/user-docs/index.md Co-Authored-By: Michael Niksa <miniksa@microsoft.com> * Update doc/user-docs/index.md Co-Authored-By: Michael Niksa <miniksa@microsoft.com> * Updated from suggestions in the PR * Improve path to profiles.json * Added some details about Json settings * Example Json settings, and a #TODO * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * After review and make colour US. 1. Merged in comments from PR 2. Made colour color :-( 3. Other tidy ups * Added more detais about background images * Remove some TODO comments and minot tidy up * Get rid of TODO 1. Some notes abouet cut and paste -- needs more work 2. Get rid of TODO -- replace with links to issues 3. Add some extra notes about URI for background images
2019-07-09 04:17:19 +10:00
....
```
> 👉 **Note**: To use backslashes in any path field, you'll need to escape them following JSON escaping rules (like shown above). As an alternative, you can use forward slashes ("%USERPROFILE%/wslhome").
The start of some User docs (#1577) * Start User docs * Fix typos * Addded some more TODO * Update doc/user-docs/index.md Co-Authored-By: Michael Niksa <miniksa@microsoft.com> * Update doc/user-docs/index.md Co-Authored-By: Michael Niksa <miniksa@microsoft.com> * Update doc/user-docs/index.md Co-Authored-By: Michael Niksa <miniksa@microsoft.com> * Update doc/user-docs/index.md Co-Authored-By: Michael Niksa <miniksa@microsoft.com> * Updated from suggestions in the PR * Improve path to profiles.json * Added some details about Json settings * Example Json settings, and a #TODO * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * After review and make colour US. 1. Merged in comments from PR 2. Made colour color :-( 3. Other tidy ups * Added more detais about background images * Remove some TODO comments and minot tidy up * Get rid of TODO 1. Some notes abouet cut and paste -- needs more work 2. Get rid of TODO -- replace with links to issues 3. Add some extra notes about URI for background images
2019-07-09 04:17:19 +10:00
The profile GUID is used to reference the default profile in the global settings.
The values for background image stretch mode are documented [here](https://docs.microsoft.com/en-us/uwp/api/windows.ui.xaml.media.stretch)
Add Cascading User + Default Settings (#2515) This PR represents the start of the work on Cascading User + default settings, #754. Cascading settings will be done in two parts: * [ ] Layered Default+User settings (this PR) * [ ] Dynamic Profile Generation (#2603). Until _both_ are done, _neither are going in. The dynamic profiles PR will target this PR when it's ready, but will go in as a separate commit into master. This PR covers adding one primary feature: the settings are now in two separate files: * a static `defaults.json` that ships with the package (the "default settings") * a `profiles.json` with the user's customizations (the "user settings) User settings are _layered_ upon the settings in the defaults settings. ## References Other things that might be related here: * #1378 - This seems like it's definitely fixed. The default keybindings are _much_ cleaner, and without the save-on-load behavior, the user's keybindings will be left in a good state * #1398 - This might have honestly been solved by #2475 ## PR Checklist * [x] Closes #754 * [x] Closes #1378 * [x] Closes #2566 * [x] I work here * [x] Tests added/passed * [x] Requires documentation to be updated - it **ABSOLUTELY DOES** ## Detailed Description of the Pull Request / Additional comments 1. We start by taking all of the `FromJson` functions in Profile, ColorScheme, Globals, etc, and converting them to `LayerJson` methods. These are effectively the same, with the change that instead of building a new object, they are simply layering the values on top of `this` object. 2. Next, we add tests for layering properties like that. 3. Now, we add a `defaults.json` to the package. This is the file the users can refer to as our default settings. 4. We then take that `defaults.json` and stamp it into an auto generated `.h` file, so we can use it's data without having to worry about reading it from disk. 5. We then change the `LoadAll` function in `CascadiaSettings`. Now, the function does two loads - one from the defaults, and then a second load from the `profiles.json` file, layering the settings from each source upon the previous values. 6. If the `profiles.json` file doesn't exist, we'll create it from a hardcoded `userDefaults.json`, which is stamped in similar to how `defaults.json` is. 7. We also add support for _unbinding_ keybindings that might exist in the `defaults.json`, but the user doesn't want to be bound to anything. 8. We add support for _hiding_ a profile, which is useful if a user doesn't want one of the default profiles to appear in the list of profiles. ## TODO: * [x] Still need to make Alt+Click work on the settings button * [x] Need to write some user documentation on how the new settings model works * [x] Fix the pair of tests I broke (re: Duplicate profiles) <hr> * Create profiles by layering them * Update test to layer multiple times on the same profile * Add support for layering an array of profiles, but break a couple tests * Add a defaults.json to the package * Layer colorschemes * Moves tests into individual classes * adds support for layering a colorscheme on top of another * Layer an array of color schemes * oh no, this was missed with #2481 must have committed without staging this change, uh oh. Not like those tests actually work so nbd * Layer keybindings * Read settings from defaults.json + profiles.json, layer appropriately This is like 80% of #754. Needs tests. * Add tests for keybindings * add support to unbind a key with `null` or `"unbound"` or `"garbage"` * Layer or clear optional properties * Add a helper to get an optional variable for a bunch of different types In the end, I think we need to ask _was this worth it_ * Do this with the stretch mode too * Add back in the GUID check for profiles * Add some tests for global settings layering * M A D W I T H P O W E R Add a MsBuild target to auto-generate a header with the defaults.json as a string in the file. That way, we can _always_ load the defaults. Literally impossible to not. * When the user's profile.json doesn't exist, create it from a template * Re-order profiles to match the order set in the user's profiles.json * Add tests for re-ordering profiles to match user ordering * Add support for hiding profiles using `"hidden": true` * Use the hardcoded defaults.json for the exception->"use defaults" case * Somehow I messed up the git submodules? * woo documentation * Fix a Terminal.App.Unit.Tests failure * signed/unsigned is hard * Use Alt+Settings button to open the default settings * Missed a signed/unsigned * Some very preliminary PR feedback * More PR feedback Use the wil helper for the exe path Move jsonutils into their own file kill some dead code * Add templates to these bois * remove some code for generating defaults, reorder defaults.json a tad * Make guid a std::optional * Large block of PR feedback * Remove some dead code * add some comments * tag some todos * stl is love, stl is life * add `-noprofile` * Fix the crash that dustin found * -Encoding ASCII * Set a profile's default scheme to Campbell * Fix the tests I regressed * Update UsingJsonSetting.md to reflect that changes from these PRs * Change how GenerateGuidForProfile works * Make AppKeyBindings do its own serialization * Remove leftover dead code from the previous commit * Fix up an enormous number of PR nits * Fix a typo; Update the defaults to match #2378 * Tiny nits * Some typos, PR nits * Fix this broken defaults case
2019-09-16 12:57:10 -07:00
### Hiding a profile
If you want to remove a profile from the list of profiles in the new tab
rename profiles.json to settings.json, clean up the defaults (#5199) This pull request migrates `profiles.json` to `settings.json` and removes the legacy roaming AppData settings migrator. It also: * separates the key bindings in defaults.json into logical groups * syncs the universal terminal defaults with the primary defaults * removes some stray newlines that ended up at the beginning of settings.json and defaults.json 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) ```c++ 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))); ``` (end snip) ### Stop resurrecting dead roaming profiles
2020-04-01 12:09:42 -07:00
dropdown, but keep the profile around in your `settings.json` file, you can add
Add Cascading User + Default Settings (#2515) This PR represents the start of the work on Cascading User + default settings, #754. Cascading settings will be done in two parts: * [ ] Layered Default+User settings (this PR) * [ ] Dynamic Profile Generation (#2603). Until _both_ are done, _neither are going in. The dynamic profiles PR will target this PR when it's ready, but will go in as a separate commit into master. This PR covers adding one primary feature: the settings are now in two separate files: * a static `defaults.json` that ships with the package (the "default settings") * a `profiles.json` with the user's customizations (the "user settings) User settings are _layered_ upon the settings in the defaults settings. ## References Other things that might be related here: * #1378 - This seems like it's definitely fixed. The default keybindings are _much_ cleaner, and without the save-on-load behavior, the user's keybindings will be left in a good state * #1398 - This might have honestly been solved by #2475 ## PR Checklist * [x] Closes #754 * [x] Closes #1378 * [x] Closes #2566 * [x] I work here * [x] Tests added/passed * [x] Requires documentation to be updated - it **ABSOLUTELY DOES** ## Detailed Description of the Pull Request / Additional comments 1. We start by taking all of the `FromJson` functions in Profile, ColorScheme, Globals, etc, and converting them to `LayerJson` methods. These are effectively the same, with the change that instead of building a new object, they are simply layering the values on top of `this` object. 2. Next, we add tests for layering properties like that. 3. Now, we add a `defaults.json` to the package. This is the file the users can refer to as our default settings. 4. We then take that `defaults.json` and stamp it into an auto generated `.h` file, so we can use it's data without having to worry about reading it from disk. 5. We then change the `LoadAll` function in `CascadiaSettings`. Now, the function does two loads - one from the defaults, and then a second load from the `profiles.json` file, layering the settings from each source upon the previous values. 6. If the `profiles.json` file doesn't exist, we'll create it from a hardcoded `userDefaults.json`, which is stamped in similar to how `defaults.json` is. 7. We also add support for _unbinding_ keybindings that might exist in the `defaults.json`, but the user doesn't want to be bound to anything. 8. We add support for _hiding_ a profile, which is useful if a user doesn't want one of the default profiles to appear in the list of profiles. ## TODO: * [x] Still need to make Alt+Click work on the settings button * [x] Need to write some user documentation on how the new settings model works * [x] Fix the pair of tests I broke (re: Duplicate profiles) <hr> * Create profiles by layering them * Update test to layer multiple times on the same profile * Add support for layering an array of profiles, but break a couple tests * Add a defaults.json to the package * Layer colorschemes * Moves tests into individual classes * adds support for layering a colorscheme on top of another * Layer an array of color schemes * oh no, this was missed with #2481 must have committed without staging this change, uh oh. Not like those tests actually work so nbd * Layer keybindings * Read settings from defaults.json + profiles.json, layer appropriately This is like 80% of #754. Needs tests. * Add tests for keybindings * add support to unbind a key with `null` or `"unbound"` or `"garbage"` * Layer or clear optional properties * Add a helper to get an optional variable for a bunch of different types In the end, I think we need to ask _was this worth it_ * Do this with the stretch mode too * Add back in the GUID check for profiles * Add some tests for global settings layering * M A D W I T H P O W E R Add a MsBuild target to auto-generate a header with the defaults.json as a string in the file. That way, we can _always_ load the defaults. Literally impossible to not. * When the user's profile.json doesn't exist, create it from a template * Re-order profiles to match the order set in the user's profiles.json * Add tests for re-ordering profiles to match user ordering * Add support for hiding profiles using `"hidden": true` * Use the hardcoded defaults.json for the exception->"use defaults" case * Somehow I messed up the git submodules? * woo documentation * Fix a Terminal.App.Unit.Tests failure * signed/unsigned is hard * Use Alt+Settings button to open the default settings * Missed a signed/unsigned * Some very preliminary PR feedback * More PR feedback Use the wil helper for the exe path Move jsonutils into their own file kill some dead code * Add templates to these bois * remove some code for generating defaults, reorder defaults.json a tad * Make guid a std::optional * Large block of PR feedback * Remove some dead code * add some comments * tag some todos * stl is love, stl is life * add `-noprofile` * Fix the crash that dustin found * -Encoding ASCII * Set a profile's default scheme to Campbell * Fix the tests I regressed * Update UsingJsonSetting.md to reflect that changes from these PRs * Change how GenerateGuidForProfile works * Make AppKeyBindings do its own serialization * Remove leftover dead code from the previous commit * Fix up an enormous number of PR nits * Fix a typo; Update the defaults to match #2378 * Tiny nits * Some typos, PR nits * Fix this broken defaults case
2019-09-16 12:57:10 -07:00
the property `"hidden": true` to the profile's json. This can also be used to
remove the default `cmd` and PowerShell profiles, if the user does not wish to
see them.
## Color Schemes
The start of some User docs (#1577) * Start User docs * Fix typos * Addded some more TODO * Update doc/user-docs/index.md Co-Authored-By: Michael Niksa <miniksa@microsoft.com> * Update doc/user-docs/index.md Co-Authored-By: Michael Niksa <miniksa@microsoft.com> * Update doc/user-docs/index.md Co-Authored-By: Michael Niksa <miniksa@microsoft.com> * Update doc/user-docs/index.md Co-Authored-By: Michael Niksa <miniksa@microsoft.com> * Updated from suggestions in the PR * Improve path to profiles.json * Added some details about Json settings * Example Json settings, and a #TODO * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * After review and make colour US. 1. Merged in comments from PR 2. Made colour color :-( 3. Other tidy ups * Added more detais about background images * Remove some TODO comments and minot tidy up * Get rid of TODO 1. Some notes abouet cut and paste -- needs more work 2. Get rid of TODO -- replace with links to issues 3. Add some extra notes about URI for background images
2019-07-09 04:17:19 +10:00
Each scheme defines the color values to be used for various terminal escape sequences.
Each schema is identified by the name field. Examples include
```json
"name" : "Campbell",
"background" : "#0C0C0C",
"black" : "#0C0C0C",
"blue" : "#0037DA",
"foreground" : "#F2F2F2",
"green" : "#13A10E",
"red" : "#C50F1F",
"white" : "#CCCCCC",
"yellow" : "#C19C00"
...
```
The schema name can then be referenced in one or more profiles.
Add Cascading User + Default Settings (#2515) This PR represents the start of the work on Cascading User + default settings, #754. Cascading settings will be done in two parts: * [ ] Layered Default+User settings (this PR) * [ ] Dynamic Profile Generation (#2603). Until _both_ are done, _neither are going in. The dynamic profiles PR will target this PR when it's ready, but will go in as a separate commit into master. This PR covers adding one primary feature: the settings are now in two separate files: * a static `defaults.json` that ships with the package (the "default settings") * a `profiles.json` with the user's customizations (the "user settings) User settings are _layered_ upon the settings in the defaults settings. ## References Other things that might be related here: * #1378 - This seems like it's definitely fixed. The default keybindings are _much_ cleaner, and without the save-on-load behavior, the user's keybindings will be left in a good state * #1398 - This might have honestly been solved by #2475 ## PR Checklist * [x] Closes #754 * [x] Closes #1378 * [x] Closes #2566 * [x] I work here * [x] Tests added/passed * [x] Requires documentation to be updated - it **ABSOLUTELY DOES** ## Detailed Description of the Pull Request / Additional comments 1. We start by taking all of the `FromJson` functions in Profile, ColorScheme, Globals, etc, and converting them to `LayerJson` methods. These are effectively the same, with the change that instead of building a new object, they are simply layering the values on top of `this` object. 2. Next, we add tests for layering properties like that. 3. Now, we add a `defaults.json` to the package. This is the file the users can refer to as our default settings. 4. We then take that `defaults.json` and stamp it into an auto generated `.h` file, so we can use it's data without having to worry about reading it from disk. 5. We then change the `LoadAll` function in `CascadiaSettings`. Now, the function does two loads - one from the defaults, and then a second load from the `profiles.json` file, layering the settings from each source upon the previous values. 6. If the `profiles.json` file doesn't exist, we'll create it from a hardcoded `userDefaults.json`, which is stamped in similar to how `defaults.json` is. 7. We also add support for _unbinding_ keybindings that might exist in the `defaults.json`, but the user doesn't want to be bound to anything. 8. We add support for _hiding_ a profile, which is useful if a user doesn't want one of the default profiles to appear in the list of profiles. ## TODO: * [x] Still need to make Alt+Click work on the settings button * [x] Need to write some user documentation on how the new settings model works * [x] Fix the pair of tests I broke (re: Duplicate profiles) <hr> * Create profiles by layering them * Update test to layer multiple times on the same profile * Add support for layering an array of profiles, but break a couple tests * Add a defaults.json to the package * Layer colorschemes * Moves tests into individual classes * adds support for layering a colorscheme on top of another * Layer an array of color schemes * oh no, this was missed with #2481 must have committed without staging this change, uh oh. Not like those tests actually work so nbd * Layer keybindings * Read settings from defaults.json + profiles.json, layer appropriately This is like 80% of #754. Needs tests. * Add tests for keybindings * add support to unbind a key with `null` or `"unbound"` or `"garbage"` * Layer or clear optional properties * Add a helper to get an optional variable for a bunch of different types In the end, I think we need to ask _was this worth it_ * Do this with the stretch mode too * Add back in the GUID check for profiles * Add some tests for global settings layering * M A D W I T H P O W E R Add a MsBuild target to auto-generate a header with the defaults.json as a string in the file. That way, we can _always_ load the defaults. Literally impossible to not. * When the user's profile.json doesn't exist, create it from a template * Re-order profiles to match the order set in the user's profiles.json * Add tests for re-ordering profiles to match user ordering * Add support for hiding profiles using `"hidden": true` * Use the hardcoded defaults.json for the exception->"use defaults" case * Somehow I messed up the git submodules? * woo documentation * Fix a Terminal.App.Unit.Tests failure * signed/unsigned is hard * Use Alt+Settings button to open the default settings * Missed a signed/unsigned * Some very preliminary PR feedback * More PR feedback Use the wil helper for the exe path Move jsonutils into their own file kill some dead code * Add templates to these bois * remove some code for generating defaults, reorder defaults.json a tad * Make guid a std::optional * Large block of PR feedback * Remove some dead code * add some comments * tag some todos * stl is love, stl is life * add `-noprofile` * Fix the crash that dustin found * -Encoding ASCII * Set a profile's default scheme to Campbell * Fix the tests I regressed * Update UsingJsonSetting.md to reflect that changes from these PRs * Change how GenerateGuidForProfile works * Make AppKeyBindings do its own serialization * Remove leftover dead code from the previous commit * Fix up an enormous number of PR nits * Fix a typo; Update the defaults to match #2378 * Tiny nits * Some typos, PR nits * Fix this broken defaults case
2019-09-16 12:57:10 -07:00
## Settings layering
The runtime settings are actually constructed from _three_ sources:
Add Cascading User + Default Settings (#2515) This PR represents the start of the work on Cascading User + default settings, #754. Cascading settings will be done in two parts: * [ ] Layered Default+User settings (this PR) * [ ] Dynamic Profile Generation (#2603). Until _both_ are done, _neither are going in. The dynamic profiles PR will target this PR when it's ready, but will go in as a separate commit into master. This PR covers adding one primary feature: the settings are now in two separate files: * a static `defaults.json` that ships with the package (the "default settings") * a `profiles.json` with the user's customizations (the "user settings) User settings are _layered_ upon the settings in the defaults settings. ## References Other things that might be related here: * #1378 - This seems like it's definitely fixed. The default keybindings are _much_ cleaner, and without the save-on-load behavior, the user's keybindings will be left in a good state * #1398 - This might have honestly been solved by #2475 ## PR Checklist * [x] Closes #754 * [x] Closes #1378 * [x] Closes #2566 * [x] I work here * [x] Tests added/passed * [x] Requires documentation to be updated - it **ABSOLUTELY DOES** ## Detailed Description of the Pull Request / Additional comments 1. We start by taking all of the `FromJson` functions in Profile, ColorScheme, Globals, etc, and converting them to `LayerJson` methods. These are effectively the same, with the change that instead of building a new object, they are simply layering the values on top of `this` object. 2. Next, we add tests for layering properties like that. 3. Now, we add a `defaults.json` to the package. This is the file the users can refer to as our default settings. 4. We then take that `defaults.json` and stamp it into an auto generated `.h` file, so we can use it's data without having to worry about reading it from disk. 5. We then change the `LoadAll` function in `CascadiaSettings`. Now, the function does two loads - one from the defaults, and then a second load from the `profiles.json` file, layering the settings from each source upon the previous values. 6. If the `profiles.json` file doesn't exist, we'll create it from a hardcoded `userDefaults.json`, which is stamped in similar to how `defaults.json` is. 7. We also add support for _unbinding_ keybindings that might exist in the `defaults.json`, but the user doesn't want to be bound to anything. 8. We add support for _hiding_ a profile, which is useful if a user doesn't want one of the default profiles to appear in the list of profiles. ## TODO: * [x] Still need to make Alt+Click work on the settings button * [x] Need to write some user documentation on how the new settings model works * [x] Fix the pair of tests I broke (re: Duplicate profiles) <hr> * Create profiles by layering them * Update test to layer multiple times on the same profile * Add support for layering an array of profiles, but break a couple tests * Add a defaults.json to the package * Layer colorschemes * Moves tests into individual classes * adds support for layering a colorscheme on top of another * Layer an array of color schemes * oh no, this was missed with #2481 must have committed without staging this change, uh oh. Not like those tests actually work so nbd * Layer keybindings * Read settings from defaults.json + profiles.json, layer appropriately This is like 80% of #754. Needs tests. * Add tests for keybindings * add support to unbind a key with `null` or `"unbound"` or `"garbage"` * Layer or clear optional properties * Add a helper to get an optional variable for a bunch of different types In the end, I think we need to ask _was this worth it_ * Do this with the stretch mode too * Add back in the GUID check for profiles * Add some tests for global settings layering * M A D W I T H P O W E R Add a MsBuild target to auto-generate a header with the defaults.json as a string in the file. That way, we can _always_ load the defaults. Literally impossible to not. * When the user's profile.json doesn't exist, create it from a template * Re-order profiles to match the order set in the user's profiles.json * Add tests for re-ordering profiles to match user ordering * Add support for hiding profiles using `"hidden": true` * Use the hardcoded defaults.json for the exception->"use defaults" case * Somehow I messed up the git submodules? * woo documentation * Fix a Terminal.App.Unit.Tests failure * signed/unsigned is hard * Use Alt+Settings button to open the default settings * Missed a signed/unsigned * Some very preliminary PR feedback * More PR feedback Use the wil helper for the exe path Move jsonutils into their own file kill some dead code * Add templates to these bois * remove some code for generating defaults, reorder defaults.json a tad * Make guid a std::optional * Large block of PR feedback * Remove some dead code * add some comments * tag some todos * stl is love, stl is life * add `-noprofile` * Fix the crash that dustin found * -Encoding ASCII * Set a profile's default scheme to Campbell * Fix the tests I regressed * Update UsingJsonSetting.md to reflect that changes from these PRs * Change how GenerateGuidForProfile works * Make AppKeyBindings do its own serialization * Remove leftover dead code from the previous commit * Fix up an enormous number of PR nits * Fix a typo; Update the defaults to match #2378 * Tiny nits * Some typos, PR nits * Fix this broken defaults case
2019-09-16 12:57:10 -07:00
* The default settings, which are hardcoded into the application, and available
in `defaults.json`. This includes the default keybindings, color schemes, and
profiles for both Windows PowerShell and Command Prompt (`cmd.exe`).
* Dynamic Profiles, which are generated at runtime. These include Powershell
Core, the Azure Cloud Shell connector, and profiles for and WSL distros.
rename profiles.json to settings.json, clean up the defaults (#5199) This pull request migrates `profiles.json` to `settings.json` and removes the legacy roaming AppData settings migrator. It also: * separates the key bindings in defaults.json into logical groups * syncs the universal terminal defaults with the primary defaults * removes some stray newlines that ended up at the beginning of settings.json and defaults.json 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) ```c++ 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))); ``` (end snip) ### Stop resurrecting dead roaming profiles
2020-04-01 12:09:42 -07:00
* The user settings from `settings.json`.
Add Cascading User + Default Settings (#2515) This PR represents the start of the work on Cascading User + default settings, #754. Cascading settings will be done in two parts: * [ ] Layered Default+User settings (this PR) * [ ] Dynamic Profile Generation (#2603). Until _both_ are done, _neither are going in. The dynamic profiles PR will target this PR when it's ready, but will go in as a separate commit into master. This PR covers adding one primary feature: the settings are now in two separate files: * a static `defaults.json` that ships with the package (the "default settings") * a `profiles.json` with the user's customizations (the "user settings) User settings are _layered_ upon the settings in the defaults settings. ## References Other things that might be related here: * #1378 - This seems like it's definitely fixed. The default keybindings are _much_ cleaner, and without the save-on-load behavior, the user's keybindings will be left in a good state * #1398 - This might have honestly been solved by #2475 ## PR Checklist * [x] Closes #754 * [x] Closes #1378 * [x] Closes #2566 * [x] I work here * [x] Tests added/passed * [x] Requires documentation to be updated - it **ABSOLUTELY DOES** ## Detailed Description of the Pull Request / Additional comments 1. We start by taking all of the `FromJson` functions in Profile, ColorScheme, Globals, etc, and converting them to `LayerJson` methods. These are effectively the same, with the change that instead of building a new object, they are simply layering the values on top of `this` object. 2. Next, we add tests for layering properties like that. 3. Now, we add a `defaults.json` to the package. This is the file the users can refer to as our default settings. 4. We then take that `defaults.json` and stamp it into an auto generated `.h` file, so we can use it's data without having to worry about reading it from disk. 5. We then change the `LoadAll` function in `CascadiaSettings`. Now, the function does two loads - one from the defaults, and then a second load from the `profiles.json` file, layering the settings from each source upon the previous values. 6. If the `profiles.json` file doesn't exist, we'll create it from a hardcoded `userDefaults.json`, which is stamped in similar to how `defaults.json` is. 7. We also add support for _unbinding_ keybindings that might exist in the `defaults.json`, but the user doesn't want to be bound to anything. 8. We add support for _hiding_ a profile, which is useful if a user doesn't want one of the default profiles to appear in the list of profiles. ## TODO: * [x] Still need to make Alt+Click work on the settings button * [x] Need to write some user documentation on how the new settings model works * [x] Fix the pair of tests I broke (re: Duplicate profiles) <hr> * Create profiles by layering them * Update test to layer multiple times on the same profile * Add support for layering an array of profiles, but break a couple tests * Add a defaults.json to the package * Layer colorschemes * Moves tests into individual classes * adds support for layering a colorscheme on top of another * Layer an array of color schemes * oh no, this was missed with #2481 must have committed without staging this change, uh oh. Not like those tests actually work so nbd * Layer keybindings * Read settings from defaults.json + profiles.json, layer appropriately This is like 80% of #754. Needs tests. * Add tests for keybindings * add support to unbind a key with `null` or `"unbound"` or `"garbage"` * Layer or clear optional properties * Add a helper to get an optional variable for a bunch of different types In the end, I think we need to ask _was this worth it_ * Do this with the stretch mode too * Add back in the GUID check for profiles * Add some tests for global settings layering * M A D W I T H P O W E R Add a MsBuild target to auto-generate a header with the defaults.json as a string in the file. That way, we can _always_ load the defaults. Literally impossible to not. * When the user's profile.json doesn't exist, create it from a template * Re-order profiles to match the order set in the user's profiles.json * Add tests for re-ordering profiles to match user ordering * Add support for hiding profiles using `"hidden": true` * Use the hardcoded defaults.json for the exception->"use defaults" case * Somehow I messed up the git submodules? * woo documentation * Fix a Terminal.App.Unit.Tests failure * signed/unsigned is hard * Use Alt+Settings button to open the default settings * Missed a signed/unsigned * Some very preliminary PR feedback * More PR feedback Use the wil helper for the exe path Move jsonutils into their own file kill some dead code * Add templates to these bois * remove some code for generating defaults, reorder defaults.json a tad * Make guid a std::optional * Large block of PR feedback * Remove some dead code * add some comments * tag some todos * stl is love, stl is life * add `-noprofile` * Fix the crash that dustin found * -Encoding ASCII * Set a profile's default scheme to Campbell * Fix the tests I regressed * Update UsingJsonSetting.md to reflect that changes from these PRs * Change how GenerateGuidForProfile works * Make AppKeyBindings do its own serialization * Remove leftover dead code from the previous commit * Fix up an enormous number of PR nits * Fix a typo; Update the defaults to match #2378 * Tiny nits * Some typos, PR nits * Fix this broken defaults case
2019-09-16 12:57:10 -07:00
Settings from each of these sources are "layered" upon the settings from
rename profiles.json to settings.json, clean up the defaults (#5199) This pull request migrates `profiles.json` to `settings.json` and removes the legacy roaming AppData settings migrator. It also: * separates the key bindings in defaults.json into logical groups * syncs the universal terminal defaults with the primary defaults * removes some stray newlines that ended up at the beginning of settings.json and defaults.json 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) ```c++ 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))); ``` (end snip) ### Stop resurrecting dead roaming profiles
2020-04-01 12:09:42 -07:00
previous sources. In this manner, the user settings in `settings.json` can
Add Cascading User + Default Settings (#2515) This PR represents the start of the work on Cascading User + default settings, #754. Cascading settings will be done in two parts: * [ ] Layered Default+User settings (this PR) * [ ] Dynamic Profile Generation (#2603). Until _both_ are done, _neither are going in. The dynamic profiles PR will target this PR when it's ready, but will go in as a separate commit into master. This PR covers adding one primary feature: the settings are now in two separate files: * a static `defaults.json` that ships with the package (the "default settings") * a `profiles.json` with the user's customizations (the "user settings) User settings are _layered_ upon the settings in the defaults settings. ## References Other things that might be related here: * #1378 - This seems like it's definitely fixed. The default keybindings are _much_ cleaner, and without the save-on-load behavior, the user's keybindings will be left in a good state * #1398 - This might have honestly been solved by #2475 ## PR Checklist * [x] Closes #754 * [x] Closes #1378 * [x] Closes #2566 * [x] I work here * [x] Tests added/passed * [x] Requires documentation to be updated - it **ABSOLUTELY DOES** ## Detailed Description of the Pull Request / Additional comments 1. We start by taking all of the `FromJson` functions in Profile, ColorScheme, Globals, etc, and converting them to `LayerJson` methods. These are effectively the same, with the change that instead of building a new object, they are simply layering the values on top of `this` object. 2. Next, we add tests for layering properties like that. 3. Now, we add a `defaults.json` to the package. This is the file the users can refer to as our default settings. 4. We then take that `defaults.json` and stamp it into an auto generated `.h` file, so we can use it's data without having to worry about reading it from disk. 5. We then change the `LoadAll` function in `CascadiaSettings`. Now, the function does two loads - one from the defaults, and then a second load from the `profiles.json` file, layering the settings from each source upon the previous values. 6. If the `profiles.json` file doesn't exist, we'll create it from a hardcoded `userDefaults.json`, which is stamped in similar to how `defaults.json` is. 7. We also add support for _unbinding_ keybindings that might exist in the `defaults.json`, but the user doesn't want to be bound to anything. 8. We add support for _hiding_ a profile, which is useful if a user doesn't want one of the default profiles to appear in the list of profiles. ## TODO: * [x] Still need to make Alt+Click work on the settings button * [x] Need to write some user documentation on how the new settings model works * [x] Fix the pair of tests I broke (re: Duplicate profiles) <hr> * Create profiles by layering them * Update test to layer multiple times on the same profile * Add support for layering an array of profiles, but break a couple tests * Add a defaults.json to the package * Layer colorschemes * Moves tests into individual classes * adds support for layering a colorscheme on top of another * Layer an array of color schemes * oh no, this was missed with #2481 must have committed without staging this change, uh oh. Not like those tests actually work so nbd * Layer keybindings * Read settings from defaults.json + profiles.json, layer appropriately This is like 80% of #754. Needs tests. * Add tests for keybindings * add support to unbind a key with `null` or `"unbound"` or `"garbage"` * Layer or clear optional properties * Add a helper to get an optional variable for a bunch of different types In the end, I think we need to ask _was this worth it_ * Do this with the stretch mode too * Add back in the GUID check for profiles * Add some tests for global settings layering * M A D W I T H P O W E R Add a MsBuild target to auto-generate a header with the defaults.json as a string in the file. That way, we can _always_ load the defaults. Literally impossible to not. * When the user's profile.json doesn't exist, create it from a template * Re-order profiles to match the order set in the user's profiles.json * Add tests for re-ordering profiles to match user ordering * Add support for hiding profiles using `"hidden": true` * Use the hardcoded defaults.json for the exception->"use defaults" case * Somehow I messed up the git submodules? * woo documentation * Fix a Terminal.App.Unit.Tests failure * signed/unsigned is hard * Use Alt+Settings button to open the default settings * Missed a signed/unsigned * Some very preliminary PR feedback * More PR feedback Use the wil helper for the exe path Move jsonutils into their own file kill some dead code * Add templates to these bois * remove some code for generating defaults, reorder defaults.json a tad * Make guid a std::optional * Large block of PR feedback * Remove some dead code * add some comments * tag some todos * stl is love, stl is life * add `-noprofile` * Fix the crash that dustin found * -Encoding ASCII * Set a profile's default scheme to Campbell * Fix the tests I regressed * Update UsingJsonSetting.md to reflect that changes from these PRs * Change how GenerateGuidForProfile works * Make AppKeyBindings do its own serialization * Remove leftover dead code from the previous commit * Fix up an enormous number of PR nits * Fix a typo; Update the defaults to match #2378 * Tiny nits * Some typos, PR nits * Fix this broken defaults case
2019-09-16 12:57:10 -07:00
contain _only the changes from the default settings_. For example, if a user
would like to only change the color scheme of the default `cmd` profile to
"Solarized Dark", you could change your cmd profile to the following:
```js
{
// Make changes here to the cmd.exe profile
"guid": "{0caa0dad-35be-5f56-a8ff-afceeeaa6101}",
"colorScheme": "Solarized Dark"
}
```
Here, we know we're changing the `cmd` profile, because the `guid`
Add Cascading User + Default Settings (#2515) This PR represents the start of the work on Cascading User + default settings, #754. Cascading settings will be done in two parts: * [ ] Layered Default+User settings (this PR) * [ ] Dynamic Profile Generation (#2603). Until _both_ are done, _neither are going in. The dynamic profiles PR will target this PR when it's ready, but will go in as a separate commit into master. This PR covers adding one primary feature: the settings are now in two separate files: * a static `defaults.json` that ships with the package (the "default settings") * a `profiles.json` with the user's customizations (the "user settings) User settings are _layered_ upon the settings in the defaults settings. ## References Other things that might be related here: * #1378 - This seems like it's definitely fixed. The default keybindings are _much_ cleaner, and without the save-on-load behavior, the user's keybindings will be left in a good state * #1398 - This might have honestly been solved by #2475 ## PR Checklist * [x] Closes #754 * [x] Closes #1378 * [x] Closes #2566 * [x] I work here * [x] Tests added/passed * [x] Requires documentation to be updated - it **ABSOLUTELY DOES** ## Detailed Description of the Pull Request / Additional comments 1. We start by taking all of the `FromJson` functions in Profile, ColorScheme, Globals, etc, and converting them to `LayerJson` methods. These are effectively the same, with the change that instead of building a new object, they are simply layering the values on top of `this` object. 2. Next, we add tests for layering properties like that. 3. Now, we add a `defaults.json` to the package. This is the file the users can refer to as our default settings. 4. We then take that `defaults.json` and stamp it into an auto generated `.h` file, so we can use it's data without having to worry about reading it from disk. 5. We then change the `LoadAll` function in `CascadiaSettings`. Now, the function does two loads - one from the defaults, and then a second load from the `profiles.json` file, layering the settings from each source upon the previous values. 6. If the `profiles.json` file doesn't exist, we'll create it from a hardcoded `userDefaults.json`, which is stamped in similar to how `defaults.json` is. 7. We also add support for _unbinding_ keybindings that might exist in the `defaults.json`, but the user doesn't want to be bound to anything. 8. We add support for _hiding_ a profile, which is useful if a user doesn't want one of the default profiles to appear in the list of profiles. ## TODO: * [x] Still need to make Alt+Click work on the settings button * [x] Need to write some user documentation on how the new settings model works * [x] Fix the pair of tests I broke (re: Duplicate profiles) <hr> * Create profiles by layering them * Update test to layer multiple times on the same profile * Add support for layering an array of profiles, but break a couple tests * Add a defaults.json to the package * Layer colorschemes * Moves tests into individual classes * adds support for layering a colorscheme on top of another * Layer an array of color schemes * oh no, this was missed with #2481 must have committed without staging this change, uh oh. Not like those tests actually work so nbd * Layer keybindings * Read settings from defaults.json + profiles.json, layer appropriately This is like 80% of #754. Needs tests. * Add tests for keybindings * add support to unbind a key with `null` or `"unbound"` or `"garbage"` * Layer or clear optional properties * Add a helper to get an optional variable for a bunch of different types In the end, I think we need to ask _was this worth it_ * Do this with the stretch mode too * Add back in the GUID check for profiles * Add some tests for global settings layering * M A D W I T H P O W E R Add a MsBuild target to auto-generate a header with the defaults.json as a string in the file. That way, we can _always_ load the defaults. Literally impossible to not. * When the user's profile.json doesn't exist, create it from a template * Re-order profiles to match the order set in the user's profiles.json * Add tests for re-ordering profiles to match user ordering * Add support for hiding profiles using `"hidden": true` * Use the hardcoded defaults.json for the exception->"use defaults" case * Somehow I messed up the git submodules? * woo documentation * Fix a Terminal.App.Unit.Tests failure * signed/unsigned is hard * Use Alt+Settings button to open the default settings * Missed a signed/unsigned * Some very preliminary PR feedback * More PR feedback Use the wil helper for the exe path Move jsonutils into their own file kill some dead code * Add templates to these bois * remove some code for generating defaults, reorder defaults.json a tad * Make guid a std::optional * Large block of PR feedback * Remove some dead code * add some comments * tag some todos * stl is love, stl is life * add `-noprofile` * Fix the crash that dustin found * -Encoding ASCII * Set a profile's default scheme to Campbell * Fix the tests I regressed * Update UsingJsonSetting.md to reflect that changes from these PRs * Change how GenerateGuidForProfile works * Make AppKeyBindings do its own serialization * Remove leftover dead code from the previous commit * Fix up an enormous number of PR nits * Fix a typo; Update the defaults to match #2378 * Tiny nits * Some typos, PR nits * Fix this broken defaults case
2019-09-16 12:57:10 -07:00
`"{0caa0dad-35be-5f56-a8ff-afceeeaa6101}"` is `cmd`'s unique GUID. Any profiles
with that GUID will all be treated as the same object. Any changes in that
profile will overwrite those from the defaults.
Similarly, you can overwrite settings from a color scheme by defining a color
rename profiles.json to settings.json, clean up the defaults (#5199) This pull request migrates `profiles.json` to `settings.json` and removes the legacy roaming AppData settings migrator. It also: * separates the key bindings in defaults.json into logical groups * syncs the universal terminal defaults with the primary defaults * removes some stray newlines that ended up at the beginning of settings.json and defaults.json 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) ```c++ 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))); ``` (end snip) ### Stop resurrecting dead roaming profiles
2020-04-01 12:09:42 -07:00
scheme in `settings.json` with the same name as a default color scheme.
Add Cascading User + Default Settings (#2515) This PR represents the start of the work on Cascading User + default settings, #754. Cascading settings will be done in two parts: * [ ] Layered Default+User settings (this PR) * [ ] Dynamic Profile Generation (#2603). Until _both_ are done, _neither are going in. The dynamic profiles PR will target this PR when it's ready, but will go in as a separate commit into master. This PR covers adding one primary feature: the settings are now in two separate files: * a static `defaults.json` that ships with the package (the "default settings") * a `profiles.json` with the user's customizations (the "user settings) User settings are _layered_ upon the settings in the defaults settings. ## References Other things that might be related here: * #1378 - This seems like it's definitely fixed. The default keybindings are _much_ cleaner, and without the save-on-load behavior, the user's keybindings will be left in a good state * #1398 - This might have honestly been solved by #2475 ## PR Checklist * [x] Closes #754 * [x] Closes #1378 * [x] Closes #2566 * [x] I work here * [x] Tests added/passed * [x] Requires documentation to be updated - it **ABSOLUTELY DOES** ## Detailed Description of the Pull Request / Additional comments 1. We start by taking all of the `FromJson` functions in Profile, ColorScheme, Globals, etc, and converting them to `LayerJson` methods. These are effectively the same, with the change that instead of building a new object, they are simply layering the values on top of `this` object. 2. Next, we add tests for layering properties like that. 3. Now, we add a `defaults.json` to the package. This is the file the users can refer to as our default settings. 4. We then take that `defaults.json` and stamp it into an auto generated `.h` file, so we can use it's data without having to worry about reading it from disk. 5. We then change the `LoadAll` function in `CascadiaSettings`. Now, the function does two loads - one from the defaults, and then a second load from the `profiles.json` file, layering the settings from each source upon the previous values. 6. If the `profiles.json` file doesn't exist, we'll create it from a hardcoded `userDefaults.json`, which is stamped in similar to how `defaults.json` is. 7. We also add support for _unbinding_ keybindings that might exist in the `defaults.json`, but the user doesn't want to be bound to anything. 8. We add support for _hiding_ a profile, which is useful if a user doesn't want one of the default profiles to appear in the list of profiles. ## TODO: * [x] Still need to make Alt+Click work on the settings button * [x] Need to write some user documentation on how the new settings model works * [x] Fix the pair of tests I broke (re: Duplicate profiles) <hr> * Create profiles by layering them * Update test to layer multiple times on the same profile * Add support for layering an array of profiles, but break a couple tests * Add a defaults.json to the package * Layer colorschemes * Moves tests into individual classes * adds support for layering a colorscheme on top of another * Layer an array of color schemes * oh no, this was missed with #2481 must have committed without staging this change, uh oh. Not like those tests actually work so nbd * Layer keybindings * Read settings from defaults.json + profiles.json, layer appropriately This is like 80% of #754. Needs tests. * Add tests for keybindings * add support to unbind a key with `null` or `"unbound"` or `"garbage"` * Layer or clear optional properties * Add a helper to get an optional variable for a bunch of different types In the end, I think we need to ask _was this worth it_ * Do this with the stretch mode too * Add back in the GUID check for profiles * Add some tests for global settings layering * M A D W I T H P O W E R Add a MsBuild target to auto-generate a header with the defaults.json as a string in the file. That way, we can _always_ load the defaults. Literally impossible to not. * When the user's profile.json doesn't exist, create it from a template * Re-order profiles to match the order set in the user's profiles.json * Add tests for re-ordering profiles to match user ordering * Add support for hiding profiles using `"hidden": true` * Use the hardcoded defaults.json for the exception->"use defaults" case * Somehow I messed up the git submodules? * woo documentation * Fix a Terminal.App.Unit.Tests failure * signed/unsigned is hard * Use Alt+Settings button to open the default settings * Missed a signed/unsigned * Some very preliminary PR feedback * More PR feedback Use the wil helper for the exe path Move jsonutils into their own file kill some dead code * Add templates to these bois * remove some code for generating defaults, reorder defaults.json a tad * Make guid a std::optional * Large block of PR feedback * Remove some dead code * add some comments * tag some todos * stl is love, stl is life * add `-noprofile` * Fix the crash that dustin found * -Encoding ASCII * Set a profile's default scheme to Campbell * Fix the tests I regressed * Update UsingJsonSetting.md to reflect that changes from these PRs * Change how GenerateGuidForProfile works * Make AppKeyBindings do its own serialization * Remove leftover dead code from the previous commit * Fix up an enormous number of PR nits * Fix a typo; Update the defaults to match #2378 * Tiny nits * Some typos, PR nits * Fix this broken defaults case
2019-09-16 12:57:10 -07:00
If you'd like to unbind a keystroke that's bound to an action in the default
keybindings, you can set the `"command"` to `"unbound"` or `null`. This will
allow the keystroke to fallthrough to the commandline application instead of
Add Cascading User + Default Settings (#2515) This PR represents the start of the work on Cascading User + default settings, #754. Cascading settings will be done in two parts: * [ ] Layered Default+User settings (this PR) * [ ] Dynamic Profile Generation (#2603). Until _both_ are done, _neither are going in. The dynamic profiles PR will target this PR when it's ready, but will go in as a separate commit into master. This PR covers adding one primary feature: the settings are now in two separate files: * a static `defaults.json` that ships with the package (the "default settings") * a `profiles.json` with the user's customizations (the "user settings) User settings are _layered_ upon the settings in the defaults settings. ## References Other things that might be related here: * #1378 - This seems like it's definitely fixed. The default keybindings are _much_ cleaner, and without the save-on-load behavior, the user's keybindings will be left in a good state * #1398 - This might have honestly been solved by #2475 ## PR Checklist * [x] Closes #754 * [x] Closes #1378 * [x] Closes #2566 * [x] I work here * [x] Tests added/passed * [x] Requires documentation to be updated - it **ABSOLUTELY DOES** ## Detailed Description of the Pull Request / Additional comments 1. We start by taking all of the `FromJson` functions in Profile, ColorScheme, Globals, etc, and converting them to `LayerJson` methods. These are effectively the same, with the change that instead of building a new object, they are simply layering the values on top of `this` object. 2. Next, we add tests for layering properties like that. 3. Now, we add a `defaults.json` to the package. This is the file the users can refer to as our default settings. 4. We then take that `defaults.json` and stamp it into an auto generated `.h` file, so we can use it's data without having to worry about reading it from disk. 5. We then change the `LoadAll` function in `CascadiaSettings`. Now, the function does two loads - one from the defaults, and then a second load from the `profiles.json` file, layering the settings from each source upon the previous values. 6. If the `profiles.json` file doesn't exist, we'll create it from a hardcoded `userDefaults.json`, which is stamped in similar to how `defaults.json` is. 7. We also add support for _unbinding_ keybindings that might exist in the `defaults.json`, but the user doesn't want to be bound to anything. 8. We add support for _hiding_ a profile, which is useful if a user doesn't want one of the default profiles to appear in the list of profiles. ## TODO: * [x] Still need to make Alt+Click work on the settings button * [x] Need to write some user documentation on how the new settings model works * [x] Fix the pair of tests I broke (re: Duplicate profiles) <hr> * Create profiles by layering them * Update test to layer multiple times on the same profile * Add support for layering an array of profiles, but break a couple tests * Add a defaults.json to the package * Layer colorschemes * Moves tests into individual classes * adds support for layering a colorscheme on top of another * Layer an array of color schemes * oh no, this was missed with #2481 must have committed without staging this change, uh oh. Not like those tests actually work so nbd * Layer keybindings * Read settings from defaults.json + profiles.json, layer appropriately This is like 80% of #754. Needs tests. * Add tests for keybindings * add support to unbind a key with `null` or `"unbound"` or `"garbage"` * Layer or clear optional properties * Add a helper to get an optional variable for a bunch of different types In the end, I think we need to ask _was this worth it_ * Do this with the stretch mode too * Add back in the GUID check for profiles * Add some tests for global settings layering * M A D W I T H P O W E R Add a MsBuild target to auto-generate a header with the defaults.json as a string in the file. That way, we can _always_ load the defaults. Literally impossible to not. * When the user's profile.json doesn't exist, create it from a template * Re-order profiles to match the order set in the user's profiles.json * Add tests for re-ordering profiles to match user ordering * Add support for hiding profiles using `"hidden": true` * Use the hardcoded defaults.json for the exception->"use defaults" case * Somehow I messed up the git submodules? * woo documentation * Fix a Terminal.App.Unit.Tests failure * signed/unsigned is hard * Use Alt+Settings button to open the default settings * Missed a signed/unsigned * Some very preliminary PR feedback * More PR feedback Use the wil helper for the exe path Move jsonutils into their own file kill some dead code * Add templates to these bois * remove some code for generating defaults, reorder defaults.json a tad * Make guid a std::optional * Large block of PR feedback * Remove some dead code * add some comments * tag some todos * stl is love, stl is life * add `-noprofile` * Fix the crash that dustin found * -Encoding ASCII * Set a profile's default scheme to Campbell * Fix the tests I regressed * Update UsingJsonSetting.md to reflect that changes from these PRs * Change how GenerateGuidForProfile works * Make AppKeyBindings do its own serialization * Remove leftover dead code from the previous commit * Fix up an enormous number of PR nits * Fix a typo; Update the defaults to match #2378 * Tiny nits * Some typos, PR nits * Fix this broken defaults case
2019-09-16 12:57:10 -07:00
performing the default action.
### Dynamic Profiles
When dynamic profiles are created at runtime, they'll be added to the
rename profiles.json to settings.json, clean up the defaults (#5199) This pull request migrates `profiles.json` to `settings.json` and removes the legacy roaming AppData settings migrator. It also: * separates the key bindings in defaults.json into logical groups * syncs the universal terminal defaults with the primary defaults * removes some stray newlines that ended up at the beginning of settings.json and defaults.json 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) ```c++ 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))); ``` (end snip) ### Stop resurrecting dead roaming profiles
2020-04-01 12:09:42 -07:00
`settings.json` file. You can identify these profiles by the presence of a
Add Cascading User + Default Settings (#2515) This PR represents the start of the work on Cascading User + default settings, #754. Cascading settings will be done in two parts: * [ ] Layered Default+User settings (this PR) * [ ] Dynamic Profile Generation (#2603). Until _both_ are done, _neither are going in. The dynamic profiles PR will target this PR when it's ready, but will go in as a separate commit into master. This PR covers adding one primary feature: the settings are now in two separate files: * a static `defaults.json` that ships with the package (the "default settings") * a `profiles.json` with the user's customizations (the "user settings) User settings are _layered_ upon the settings in the defaults settings. ## References Other things that might be related here: * #1378 - This seems like it's definitely fixed. The default keybindings are _much_ cleaner, and without the save-on-load behavior, the user's keybindings will be left in a good state * #1398 - This might have honestly been solved by #2475 ## PR Checklist * [x] Closes #754 * [x] Closes #1378 * [x] Closes #2566 * [x] I work here * [x] Tests added/passed * [x] Requires documentation to be updated - it **ABSOLUTELY DOES** ## Detailed Description of the Pull Request / Additional comments 1. We start by taking all of the `FromJson` functions in Profile, ColorScheme, Globals, etc, and converting them to `LayerJson` methods. These are effectively the same, with the change that instead of building a new object, they are simply layering the values on top of `this` object. 2. Next, we add tests for layering properties like that. 3. Now, we add a `defaults.json` to the package. This is the file the users can refer to as our default settings. 4. We then take that `defaults.json` and stamp it into an auto generated `.h` file, so we can use it's data without having to worry about reading it from disk. 5. We then change the `LoadAll` function in `CascadiaSettings`. Now, the function does two loads - one from the defaults, and then a second load from the `profiles.json` file, layering the settings from each source upon the previous values. 6. If the `profiles.json` file doesn't exist, we'll create it from a hardcoded `userDefaults.json`, which is stamped in similar to how `defaults.json` is. 7. We also add support for _unbinding_ keybindings that might exist in the `defaults.json`, but the user doesn't want to be bound to anything. 8. We add support for _hiding_ a profile, which is useful if a user doesn't want one of the default profiles to appear in the list of profiles. ## TODO: * [x] Still need to make Alt+Click work on the settings button * [x] Need to write some user documentation on how the new settings model works * [x] Fix the pair of tests I broke (re: Duplicate profiles) <hr> * Create profiles by layering them * Update test to layer multiple times on the same profile * Add support for layering an array of profiles, but break a couple tests * Add a defaults.json to the package * Layer colorschemes * Moves tests into individual classes * adds support for layering a colorscheme on top of another * Layer an array of color schemes * oh no, this was missed with #2481 must have committed without staging this change, uh oh. Not like those tests actually work so nbd * Layer keybindings * Read settings from defaults.json + profiles.json, layer appropriately This is like 80% of #754. Needs tests. * Add tests for keybindings * add support to unbind a key with `null` or `"unbound"` or `"garbage"` * Layer or clear optional properties * Add a helper to get an optional variable for a bunch of different types In the end, I think we need to ask _was this worth it_ * Do this with the stretch mode too * Add back in the GUID check for profiles * Add some tests for global settings layering * M A D W I T H P O W E R Add a MsBuild target to auto-generate a header with the defaults.json as a string in the file. That way, we can _always_ load the defaults. Literally impossible to not. * When the user's profile.json doesn't exist, create it from a template * Re-order profiles to match the order set in the user's profiles.json * Add tests for re-ordering profiles to match user ordering * Add support for hiding profiles using `"hidden": true` * Use the hardcoded defaults.json for the exception->"use defaults" case * Somehow I messed up the git submodules? * woo documentation * Fix a Terminal.App.Unit.Tests failure * signed/unsigned is hard * Use Alt+Settings button to open the default settings * Missed a signed/unsigned * Some very preliminary PR feedback * More PR feedback Use the wil helper for the exe path Move jsonutils into their own file kill some dead code * Add templates to these bois * remove some code for generating defaults, reorder defaults.json a tad * Make guid a std::optional * Large block of PR feedback * Remove some dead code * add some comments * tag some todos * stl is love, stl is life * add `-noprofile` * Fix the crash that dustin found * -Encoding ASCII * Set a profile's default scheme to Campbell * Fix the tests I regressed * Update UsingJsonSetting.md to reflect that changes from these PRs * Change how GenerateGuidForProfile works * Make AppKeyBindings do its own serialization * Remove leftover dead code from the previous commit * Fix up an enormous number of PR nits * Fix a typo; Update the defaults to match #2378 * Tiny nits * Some typos, PR nits * Fix this broken defaults case
2019-09-16 12:57:10 -07:00
`"source"` property. These profiles are tied to their source - if you uninstall
rename profiles.json to settings.json, clean up the defaults (#5199) This pull request migrates `profiles.json` to `settings.json` and removes the legacy roaming AppData settings migrator. It also: * separates the key bindings in defaults.json into logical groups * syncs the universal terminal defaults with the primary defaults * removes some stray newlines that ended up at the beginning of settings.json and defaults.json 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) ```c++ 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))); ``` (end snip) ### Stop resurrecting dead roaming profiles
2020-04-01 12:09:42 -07:00
a linux distro, then the profile will remain in your `settings.json` file, but
Add Cascading User + Default Settings (#2515) This PR represents the start of the work on Cascading User + default settings, #754. Cascading settings will be done in two parts: * [ ] Layered Default+User settings (this PR) * [ ] Dynamic Profile Generation (#2603). Until _both_ are done, _neither are going in. The dynamic profiles PR will target this PR when it's ready, but will go in as a separate commit into master. This PR covers adding one primary feature: the settings are now in two separate files: * a static `defaults.json` that ships with the package (the "default settings") * a `profiles.json` with the user's customizations (the "user settings) User settings are _layered_ upon the settings in the defaults settings. ## References Other things that might be related here: * #1378 - This seems like it's definitely fixed. The default keybindings are _much_ cleaner, and without the save-on-load behavior, the user's keybindings will be left in a good state * #1398 - This might have honestly been solved by #2475 ## PR Checklist * [x] Closes #754 * [x] Closes #1378 * [x] Closes #2566 * [x] I work here * [x] Tests added/passed * [x] Requires documentation to be updated - it **ABSOLUTELY DOES** ## Detailed Description of the Pull Request / Additional comments 1. We start by taking all of the `FromJson` functions in Profile, ColorScheme, Globals, etc, and converting them to `LayerJson` methods. These are effectively the same, with the change that instead of building a new object, they are simply layering the values on top of `this` object. 2. Next, we add tests for layering properties like that. 3. Now, we add a `defaults.json` to the package. This is the file the users can refer to as our default settings. 4. We then take that `defaults.json` and stamp it into an auto generated `.h` file, so we can use it's data without having to worry about reading it from disk. 5. We then change the `LoadAll` function in `CascadiaSettings`. Now, the function does two loads - one from the defaults, and then a second load from the `profiles.json` file, layering the settings from each source upon the previous values. 6. If the `profiles.json` file doesn't exist, we'll create it from a hardcoded `userDefaults.json`, which is stamped in similar to how `defaults.json` is. 7. We also add support for _unbinding_ keybindings that might exist in the `defaults.json`, but the user doesn't want to be bound to anything. 8. We add support for _hiding_ a profile, which is useful if a user doesn't want one of the default profiles to appear in the list of profiles. ## TODO: * [x] Still need to make Alt+Click work on the settings button * [x] Need to write some user documentation on how the new settings model works * [x] Fix the pair of tests I broke (re: Duplicate profiles) <hr> * Create profiles by layering them * Update test to layer multiple times on the same profile * Add support for layering an array of profiles, but break a couple tests * Add a defaults.json to the package * Layer colorschemes * Moves tests into individual classes * adds support for layering a colorscheme on top of another * Layer an array of color schemes * oh no, this was missed with #2481 must have committed without staging this change, uh oh. Not like those tests actually work so nbd * Layer keybindings * Read settings from defaults.json + profiles.json, layer appropriately This is like 80% of #754. Needs tests. * Add tests for keybindings * add support to unbind a key with `null` or `"unbound"` or `"garbage"` * Layer or clear optional properties * Add a helper to get an optional variable for a bunch of different types In the end, I think we need to ask _was this worth it_ * Do this with the stretch mode too * Add back in the GUID check for profiles * Add some tests for global settings layering * M A D W I T H P O W E R Add a MsBuild target to auto-generate a header with the defaults.json as a string in the file. That way, we can _always_ load the defaults. Literally impossible to not. * When the user's profile.json doesn't exist, create it from a template * Re-order profiles to match the order set in the user's profiles.json * Add tests for re-ordering profiles to match user ordering * Add support for hiding profiles using `"hidden": true` * Use the hardcoded defaults.json for the exception->"use defaults" case * Somehow I messed up the git submodules? * woo documentation * Fix a Terminal.App.Unit.Tests failure * signed/unsigned is hard * Use Alt+Settings button to open the default settings * Missed a signed/unsigned * Some very preliminary PR feedback * More PR feedback Use the wil helper for the exe path Move jsonutils into their own file kill some dead code * Add templates to these bois * remove some code for generating defaults, reorder defaults.json a tad * Make guid a std::optional * Large block of PR feedback * Remove some dead code * add some comments * tag some todos * stl is love, stl is life * add `-noprofile` * Fix the crash that dustin found * -Encoding ASCII * Set a profile's default scheme to Campbell * Fix the tests I regressed * Update UsingJsonSetting.md to reflect that changes from these PRs * Change how GenerateGuidForProfile works * Make AppKeyBindings do its own serialization * Remove leftover dead code from the previous commit * Fix up an enormous number of PR nits * Fix a typo; Update the defaults to match #2378 * Tiny nits * Some typos, PR nits * Fix this broken defaults case
2019-09-16 12:57:10 -07:00
the profile will be hidden.
The Windows Terminal uses the `guid` property of these dynamically-generated
profiles to uniquely identify them. If you try to change the `guid` of a
dynamically-generated profile, the Terminal will automatically recreate a new
entry for that profile.
Add Cascading User + Default Settings (#2515) This PR represents the start of the work on Cascading User + default settings, #754. Cascading settings will be done in two parts: * [ ] Layered Default+User settings (this PR) * [ ] Dynamic Profile Generation (#2603). Until _both_ are done, _neither are going in. The dynamic profiles PR will target this PR when it's ready, but will go in as a separate commit into master. This PR covers adding one primary feature: the settings are now in two separate files: * a static `defaults.json` that ships with the package (the "default settings") * a `profiles.json` with the user's customizations (the "user settings) User settings are _layered_ upon the settings in the defaults settings. ## References Other things that might be related here: * #1378 - This seems like it's definitely fixed. The default keybindings are _much_ cleaner, and without the save-on-load behavior, the user's keybindings will be left in a good state * #1398 - This might have honestly been solved by #2475 ## PR Checklist * [x] Closes #754 * [x] Closes #1378 * [x] Closes #2566 * [x] I work here * [x] Tests added/passed * [x] Requires documentation to be updated - it **ABSOLUTELY DOES** ## Detailed Description of the Pull Request / Additional comments 1. We start by taking all of the `FromJson` functions in Profile, ColorScheme, Globals, etc, and converting them to `LayerJson` methods. These are effectively the same, with the change that instead of building a new object, they are simply layering the values on top of `this` object. 2. Next, we add tests for layering properties like that. 3. Now, we add a `defaults.json` to the package. This is the file the users can refer to as our default settings. 4. We then take that `defaults.json` and stamp it into an auto generated `.h` file, so we can use it's data without having to worry about reading it from disk. 5. We then change the `LoadAll` function in `CascadiaSettings`. Now, the function does two loads - one from the defaults, and then a second load from the `profiles.json` file, layering the settings from each source upon the previous values. 6. If the `profiles.json` file doesn't exist, we'll create it from a hardcoded `userDefaults.json`, which is stamped in similar to how `defaults.json` is. 7. We also add support for _unbinding_ keybindings that might exist in the `defaults.json`, but the user doesn't want to be bound to anything. 8. We add support for _hiding_ a profile, which is useful if a user doesn't want one of the default profiles to appear in the list of profiles. ## TODO: * [x] Still need to make Alt+Click work on the settings button * [x] Need to write some user documentation on how the new settings model works * [x] Fix the pair of tests I broke (re: Duplicate profiles) <hr> * Create profiles by layering them * Update test to layer multiple times on the same profile * Add support for layering an array of profiles, but break a couple tests * Add a defaults.json to the package * Layer colorschemes * Moves tests into individual classes * adds support for layering a colorscheme on top of another * Layer an array of color schemes * oh no, this was missed with #2481 must have committed without staging this change, uh oh. Not like those tests actually work so nbd * Layer keybindings * Read settings from defaults.json + profiles.json, layer appropriately This is like 80% of #754. Needs tests. * Add tests for keybindings * add support to unbind a key with `null` or `"unbound"` or `"garbage"` * Layer or clear optional properties * Add a helper to get an optional variable for a bunch of different types In the end, I think we need to ask _was this worth it_ * Do this with the stretch mode too * Add back in the GUID check for profiles * Add some tests for global settings layering * M A D W I T H P O W E R Add a MsBuild target to auto-generate a header with the defaults.json as a string in the file. That way, we can _always_ load the defaults. Literally impossible to not. * When the user's profile.json doesn't exist, create it from a template * Re-order profiles to match the order set in the user's profiles.json * Add tests for re-ordering profiles to match user ordering * Add support for hiding profiles using `"hidden": true` * Use the hardcoded defaults.json for the exception->"use defaults" case * Somehow I messed up the git submodules? * woo documentation * Fix a Terminal.App.Unit.Tests failure * signed/unsigned is hard * Use Alt+Settings button to open the default settings * Missed a signed/unsigned * Some very preliminary PR feedback * More PR feedback Use the wil helper for the exe path Move jsonutils into their own file kill some dead code * Add templates to these bois * remove some code for generating defaults, reorder defaults.json a tad * Make guid a std::optional * Large block of PR feedback * Remove some dead code * add some comments * tag some todos * stl is love, stl is life * add `-noprofile` * Fix the crash that dustin found * -Encoding ASCII * Set a profile's default scheme to Campbell * Fix the tests I regressed * Update UsingJsonSetting.md to reflect that changes from these PRs * Change how GenerateGuidForProfile works * Make AppKeyBindings do its own serialization * Remove leftover dead code from the previous commit * Fix up an enormous number of PR nits * Fix a typo; Update the defaults to match #2378 * Tiny nits * Some typos, PR nits * Fix this broken defaults case
2019-09-16 12:57:10 -07:00
If you'd like to disable a particular dynamic profile source, you can add that
`source` to the global `"disabledProfileSources"` array. For example, if you'd
like to hide all the WSL profiles, you could add the following setting:
```json
"disabledProfileSources": ["Windows.Terminal.WSL"],
Add Cascading User + Default Settings (#2515) This PR represents the start of the work on Cascading User + default settings, #754. Cascading settings will be done in two parts: * [ ] Layered Default+User settings (this PR) * [ ] Dynamic Profile Generation (#2603). Until _both_ are done, _neither are going in. The dynamic profiles PR will target this PR when it's ready, but will go in as a separate commit into master. This PR covers adding one primary feature: the settings are now in two separate files: * a static `defaults.json` that ships with the package (the "default settings") * a `profiles.json` with the user's customizations (the "user settings) User settings are _layered_ upon the settings in the defaults settings. ## References Other things that might be related here: * #1378 - This seems like it's definitely fixed. The default keybindings are _much_ cleaner, and without the save-on-load behavior, the user's keybindings will be left in a good state * #1398 - This might have honestly been solved by #2475 ## PR Checklist * [x] Closes #754 * [x] Closes #1378 * [x] Closes #2566 * [x] I work here * [x] Tests added/passed * [x] Requires documentation to be updated - it **ABSOLUTELY DOES** ## Detailed Description of the Pull Request / Additional comments 1. We start by taking all of the `FromJson` functions in Profile, ColorScheme, Globals, etc, and converting them to `LayerJson` methods. These are effectively the same, with the change that instead of building a new object, they are simply layering the values on top of `this` object. 2. Next, we add tests for layering properties like that. 3. Now, we add a `defaults.json` to the package. This is the file the users can refer to as our default settings. 4. We then take that `defaults.json` and stamp it into an auto generated `.h` file, so we can use it's data without having to worry about reading it from disk. 5. We then change the `LoadAll` function in `CascadiaSettings`. Now, the function does two loads - one from the defaults, and then a second load from the `profiles.json` file, layering the settings from each source upon the previous values. 6. If the `profiles.json` file doesn't exist, we'll create it from a hardcoded `userDefaults.json`, which is stamped in similar to how `defaults.json` is. 7. We also add support for _unbinding_ keybindings that might exist in the `defaults.json`, but the user doesn't want to be bound to anything. 8. We add support for _hiding_ a profile, which is useful if a user doesn't want one of the default profiles to appear in the list of profiles. ## TODO: * [x] Still need to make Alt+Click work on the settings button * [x] Need to write some user documentation on how the new settings model works * [x] Fix the pair of tests I broke (re: Duplicate profiles) <hr> * Create profiles by layering them * Update test to layer multiple times on the same profile * Add support for layering an array of profiles, but break a couple tests * Add a defaults.json to the package * Layer colorschemes * Moves tests into individual classes * adds support for layering a colorscheme on top of another * Layer an array of color schemes * oh no, this was missed with #2481 must have committed without staging this change, uh oh. Not like those tests actually work so nbd * Layer keybindings * Read settings from defaults.json + profiles.json, layer appropriately This is like 80% of #754. Needs tests. * Add tests for keybindings * add support to unbind a key with `null` or `"unbound"` or `"garbage"` * Layer or clear optional properties * Add a helper to get an optional variable for a bunch of different types In the end, I think we need to ask _was this worth it_ * Do this with the stretch mode too * Add back in the GUID check for profiles * Add some tests for global settings layering * M A D W I T H P O W E R Add a MsBuild target to auto-generate a header with the defaults.json as a string in the file. That way, we can _always_ load the defaults. Literally impossible to not. * When the user's profile.json doesn't exist, create it from a template * Re-order profiles to match the order set in the user's profiles.json * Add tests for re-ordering profiles to match user ordering * Add support for hiding profiles using `"hidden": true` * Use the hardcoded defaults.json for the exception->"use defaults" case * Somehow I messed up the git submodules? * woo documentation * Fix a Terminal.App.Unit.Tests failure * signed/unsigned is hard * Use Alt+Settings button to open the default settings * Missed a signed/unsigned * Some very preliminary PR feedback * More PR feedback Use the wil helper for the exe path Move jsonutils into their own file kill some dead code * Add templates to these bois * remove some code for generating defaults, reorder defaults.json a tad * Make guid a std::optional * Large block of PR feedback * Remove some dead code * add some comments * tag some todos * stl is love, stl is life * add `-noprofile` * Fix the crash that dustin found * -Encoding ASCII * Set a profile's default scheme to Campbell * Fix the tests I regressed * Update UsingJsonSetting.md to reflect that changes from these PRs * Change how GenerateGuidForProfile works * Make AppKeyBindings do its own serialization * Remove leftover dead code from the previous commit * Fix up an enormous number of PR nits * Fix a typo; Update the defaults to match #2378 * Tiny nits * Some typos, PR nits * Fix this broken defaults case
2019-09-16 12:57:10 -07:00
...
```
### Default settings
In [#2325](https://github.com/microsoft/terminal/issues/2325), we introduced the
concept of "Default Profile Settings". These are settings that will apply to all
of your profiles by default. Profiles can still override these settings
individually. With default profile settings, you can easily make changes to all
your profiles at once. For example, given the following settings:
```json
"defaultProfile": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
"profiles":
[
{
"guid": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
"name": "Windows PowerShell",
"commandline": "powershell.exe",
"fontFace": "Cascadia Code",
"fontSize": 14
},
{
"guid": "{0caa0dad-35be-5f56-a8ff-afceeeaa6101}",
"name": "cmd",
"commandline": "cmd.exe",
"fontFace": "Cascadia Code",
"fontSize": 14
},
{
"commandline" : "cmd.exe /k %CMDER_ROOT%\\vendor\\init.bat",
"name" : "cmder",
"startingDirectory" : "%USERPROFILE%",
"fontFace": "Cascadia Code",
"fontSize": 14
}
],
```
All three of these profiles are using "Cascadia Code" as their `"fontFace"`, and
14 as their `fontSize`. With default profile settings, you can easily set these
properties for all your profiles, like so:
```json
"defaultProfile": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
"profiles": {
"defaults":
{
"fontFace": "Cascadia Code",
"fontSize": 14
},
"list": [
{
"guid": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
"name": "Windows PowerShell",
"commandline": "powershell.exe"
},
{
"guid": "{0caa0dad-35be-5f56-a8ff-afceeeaa6101}",
"name": "cmd",
"commandline": "cmd.exe"
},
{
"commandline" : "cmd.exe /k %CMDER_ROOT%\\vendor\\init.bat",
"name" : "cmder",
"startingDirectory" : "%USERPROFILE%"
}
]
},
```
Note that the `profiles` property has changed in this example from a _list_ of
profiles, to an _object_ with two properties:
* a `list` that contains the list of all the profiles
* the new `defaults` object, which contains all the settings that should apply to
every profile.
What if I wanted a profile to have a different value for a property other than
the default? Simply set the property in the profile's entry to override the
value from `defaults`. Let's say you want the `cmd` profile to have _"Consolas"_
as the font, but the rest of your profiles to still have _"Cascadia Code"_. You
could achieve that with the following:
```json
"defaultProfile": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
"profiles": {
"defaults":
{
"fontFace": "Cascadia Code",
"fontSize": 14
},
"list": [
{
"guid": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
"name": "Windows PowerShell",
"commandline": "powershell.exe"
},
{
"guid": "{0caa0dad-35be-5f56-a8ff-afceeeaa6101}",
"name": "cmd",
"commandline": "cmd.exe",
"fontFace": "Consolas"
},
{
"commandline" : "cmd.exe /k %CMDER_ROOT%\\vendor\\init.bat",
"name" : "cmder",
"startingDirectory" : "%USERPROFILE%"
}
]
},
```
In the above settings, the `"fontFace"` in the `cmd.exe` profile overrides the
`"fontFace"` from the `defaults`.
## Configuration Examples
The start of some User docs (#1577) * Start User docs * Fix typos * Addded some more TODO * Update doc/user-docs/index.md Co-Authored-By: Michael Niksa <miniksa@microsoft.com> * Update doc/user-docs/index.md Co-Authored-By: Michael Niksa <miniksa@microsoft.com> * Update doc/user-docs/index.md Co-Authored-By: Michael Niksa <miniksa@microsoft.com> * Update doc/user-docs/index.md Co-Authored-By: Michael Niksa <miniksa@microsoft.com> * Updated from suggestions in the PR * Improve path to profiles.json * Added some details about Json settings * Example Json settings, and a #TODO * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * After review and make colour US. 1. Merged in comments from PR 2. Made colour color :-( 3. Other tidy ups * Added more detais about background images * Remove some TODO comments and minot tidy up * Get rid of TODO 1. Some notes abouet cut and paste -- needs more work 2. Get rid of TODO -- replace with links to issues 3. Add some extra notes about URI for background images
2019-07-09 04:17:19 +10:00
### Add a custom background to the WSL Debian terminal profile
1. Download the [Debian JPG logo](https://www.debian.org/logos/openlogo-100.jpg)
The start of some User docs (#1577) * Start User docs * Fix typos * Addded some more TODO * Update doc/user-docs/index.md Co-Authored-By: Michael Niksa <miniksa@microsoft.com> * Update doc/user-docs/index.md Co-Authored-By: Michael Niksa <miniksa@microsoft.com> * Update doc/user-docs/index.md Co-Authored-By: Michael Niksa <miniksa@microsoft.com> * Update doc/user-docs/index.md Co-Authored-By: Michael Niksa <miniksa@microsoft.com> * Updated from suggestions in the PR * Improve path to profiles.json * Added some details about Json settings * Example Json settings, and a #TODO * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * After review and make colour US. 1. Merged in comments from PR 2. Made colour color :-( 3. Other tidy ups * Added more detais about background images * Remove some TODO comments and minot tidy up * Get rid of TODO 1. Some notes abouet cut and paste -- needs more work 2. Get rid of TODO -- replace with links to issues 3. Add some extra notes about URI for background images
2019-07-09 04:17:19 +10:00
2. Put the image in the
`$env:LocalAppData\Packages\Microsoft.WindowsTerminal_<randomString>\LocalState\`
rename profiles.json to settings.json, clean up the defaults (#5199) This pull request migrates `profiles.json` to `settings.json` and removes the legacy roaming AppData settings migrator. It also: * separates the key bindings in defaults.json into logical groups * syncs the universal terminal defaults with the primary defaults * removes some stray newlines that ended up at the beginning of settings.json and defaults.json 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) ```c++ 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))); ``` (end snip) ### Stop resurrecting dead roaming profiles
2020-04-01 12:09:42 -07:00
directory (same directory as your `settings.json` file).
The start of some User docs (#1577) * Start User docs * Fix typos * Addded some more TODO * Update doc/user-docs/index.md Co-Authored-By: Michael Niksa <miniksa@microsoft.com> * Update doc/user-docs/index.md Co-Authored-By: Michael Niksa <miniksa@microsoft.com> * Update doc/user-docs/index.md Co-Authored-By: Michael Niksa <miniksa@microsoft.com> * Update doc/user-docs/index.md Co-Authored-By: Michael Niksa <miniksa@microsoft.com> * Updated from suggestions in the PR * Improve path to profiles.json * Added some details about Json settings * Example Json settings, and a #TODO * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * After review and make colour US. 1. Merged in comments from PR 2. Made colour color :-( 3. Other tidy ups * Added more detais about background images * Remove some TODO comments and minot tidy up * Get rid of TODO 1. Some notes abouet cut and paste -- needs more work 2. Get rid of TODO -- replace with links to issues 3. Add some extra notes about URI for background images
2019-07-09 04:17:19 +10:00
__NOTE__: You can put the image anywhere you like, the above suggestion happens to be convenient.
3. Open your WT json properties file.
4. Under the Debian Linux profile, add the following fields:
The start of some User docs (#1577) * Start User docs * Fix typos * Addded some more TODO * Update doc/user-docs/index.md Co-Authored-By: Michael Niksa <miniksa@microsoft.com> * Update doc/user-docs/index.md Co-Authored-By: Michael Niksa <miniksa@microsoft.com> * Update doc/user-docs/index.md Co-Authored-By: Michael Niksa <miniksa@microsoft.com> * Update doc/user-docs/index.md Co-Authored-By: Michael Niksa <miniksa@microsoft.com> * Updated from suggestions in the PR * Improve path to profiles.json * Added some details about Json settings * Example Json settings, and a #TODO * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * After review and make colour US. 1. Merged in comments from PR 2. Made colour color :-( 3. Other tidy ups * Added more detais about background images * Remove some TODO comments and minot tidy up * Get rid of TODO 1. Some notes abouet cut and paste -- needs more work 2. Get rid of TODO -- replace with links to issues 3. Add some extra notes about URI for background images
2019-07-09 04:17:19 +10:00
```json
"backgroundImage": "ms-appdata:///Local/openlogo-100.jpg",
"backgroundImageOpacity": 1,
"backgroundImageStretchMode" : "none",
"backgroundImageAlignment" : "topRight",
The start of some User docs (#1577) * Start User docs * Fix typos * Addded some more TODO * Update doc/user-docs/index.md Co-Authored-By: Michael Niksa <miniksa@microsoft.com> * Update doc/user-docs/index.md Co-Authored-By: Michael Niksa <miniksa@microsoft.com> * Update doc/user-docs/index.md Co-Authored-By: Michael Niksa <miniksa@microsoft.com> * Update doc/user-docs/index.md Co-Authored-By: Michael Niksa <miniksa@microsoft.com> * Updated from suggestions in the PR * Improve path to profiles.json * Added some details about Json settings * Example Json settings, and a #TODO * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * After review and make colour US. 1. Merged in comments from PR 2. Made colour color :-( 3. Other tidy ups * Added more detais about background images * Remove some TODO comments and minot tidy up * Get rid of TODO 1. Some notes abouet cut and paste -- needs more work 2. Get rid of TODO -- replace with links to issues 3. Add some extra notes about URI for background images
2019-07-09 04:17:19 +10:00
```
The start of some User docs (#1577) * Start User docs * Fix typos * Addded some more TODO * Update doc/user-docs/index.md Co-Authored-By: Michael Niksa <miniksa@microsoft.com> * Update doc/user-docs/index.md Co-Authored-By: Michael Niksa <miniksa@microsoft.com> * Update doc/user-docs/index.md Co-Authored-By: Michael Niksa <miniksa@microsoft.com> * Update doc/user-docs/index.md Co-Authored-By: Michael Niksa <miniksa@microsoft.com> * Updated from suggestions in the PR * Improve path to profiles.json * Added some details about Json settings * Example Json settings, and a #TODO * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * After review and make colour US. 1. Merged in comments from PR 2. Made colour color :-( 3. Other tidy ups * Added more detais about background images * Remove some TODO comments and minot tidy up * Get rid of TODO 1. Some notes abouet cut and paste -- needs more work 2. Get rid of TODO -- replace with links to issues 3. Add some extra notes about URI for background images
2019-07-09 04:17:19 +10:00
5. Make sure that `useAcrylic` is `false`.
6. Save the file.
7. Jump over to WT and verify your changes.
Notes:
The start of some User docs (#1577) * Start User docs * Fix typos * Addded some more TODO * Update doc/user-docs/index.md Co-Authored-By: Michael Niksa <miniksa@microsoft.com> * Update doc/user-docs/index.md Co-Authored-By: Michael Niksa <miniksa@microsoft.com> * Update doc/user-docs/index.md Co-Authored-By: Michael Niksa <miniksa@microsoft.com> * Update doc/user-docs/index.md Co-Authored-By: Michael Niksa <miniksa@microsoft.com> * Updated from suggestions in the PR * Improve path to profiles.json * Added some details about Json settings * Example Json settings, and a #TODO * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * After review and make colour US. 1. Merged in comments from PR 2. Made colour color :-( 3. Other tidy ups * Added more detais about background images * Remove some TODO comments and minot tidy up * Get rid of TODO 1. Some notes abouet cut and paste -- needs more work 2. Get rid of TODO -- replace with links to issues 3. Add some extra notes about URI for background images
2019-07-09 04:17:19 +10:00
1. You will need to experiment with different color settings
and schemes to make your terminal text visible on top of your image
rename profiles.json to settings.json, clean up the defaults (#5199) This pull request migrates `profiles.json` to `settings.json` and removes the legacy roaming AppData settings migrator. It also: * separates the key bindings in defaults.json into logical groups * syncs the universal terminal defaults with the primary defaults * removes some stray newlines that ended up at the beginning of settings.json and defaults.json 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) ```c++ 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))); ``` (end snip) ### Stop resurrecting dead roaming profiles
2020-04-01 12:09:42 -07:00
2. If you store the image in the UWP directory (the same directory as your settings.json file),
The start of some User docs (#1577) * Start User docs * Fix typos * Addded some more TODO * Update doc/user-docs/index.md Co-Authored-By: Michael Niksa <miniksa@microsoft.com> * Update doc/user-docs/index.md Co-Authored-By: Michael Niksa <miniksa@microsoft.com> * Update doc/user-docs/index.md Co-Authored-By: Michael Niksa <miniksa@microsoft.com> * Update doc/user-docs/index.md Co-Authored-By: Michael Niksa <miniksa@microsoft.com> * Updated from suggestions in the PR * Improve path to profiles.json * Added some details about Json settings * Example Json settings, and a #TODO * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * After review and make colour US. 1. Merged in comments from PR 2. Made colour color :-( 3. Other tidy ups * Added more detais about background images * Remove some TODO comments and minot tidy up * Get rid of TODO 1. Some notes abouet cut and paste -- needs more work 2. Get rid of TODO -- replace with links to issues 3. Add some extra notes about URI for background images
2019-07-09 04:17:19 +10:00
then you should use the URI style path name given in the above example.
More information about UWP URI schemes [here](https://docs.microsoft.com/en-us/windows/uwp/app-resources/uri-schemes).
3. Instead of using a UWP URI you can use a:
1. URL such as
Add Cascading User + Default Settings (#2515) This PR represents the start of the work on Cascading User + default settings, #754. Cascading settings will be done in two parts: * [ ] Layered Default+User settings (this PR) * [ ] Dynamic Profile Generation (#2603). Until _both_ are done, _neither are going in. The dynamic profiles PR will target this PR when it's ready, but will go in as a separate commit into master. This PR covers adding one primary feature: the settings are now in two separate files: * a static `defaults.json` that ships with the package (the "default settings") * a `profiles.json` with the user's customizations (the "user settings) User settings are _layered_ upon the settings in the defaults settings. ## References Other things that might be related here: * #1378 - This seems like it's definitely fixed. The default keybindings are _much_ cleaner, and without the save-on-load behavior, the user's keybindings will be left in a good state * #1398 - This might have honestly been solved by #2475 ## PR Checklist * [x] Closes #754 * [x] Closes #1378 * [x] Closes #2566 * [x] I work here * [x] Tests added/passed * [x] Requires documentation to be updated - it **ABSOLUTELY DOES** ## Detailed Description of the Pull Request / Additional comments 1. We start by taking all of the `FromJson` functions in Profile, ColorScheme, Globals, etc, and converting them to `LayerJson` methods. These are effectively the same, with the change that instead of building a new object, they are simply layering the values on top of `this` object. 2. Next, we add tests for layering properties like that. 3. Now, we add a `defaults.json` to the package. This is the file the users can refer to as our default settings. 4. We then take that `defaults.json` and stamp it into an auto generated `.h` file, so we can use it's data without having to worry about reading it from disk. 5. We then change the `LoadAll` function in `CascadiaSettings`. Now, the function does two loads - one from the defaults, and then a second load from the `profiles.json` file, layering the settings from each source upon the previous values. 6. If the `profiles.json` file doesn't exist, we'll create it from a hardcoded `userDefaults.json`, which is stamped in similar to how `defaults.json` is. 7. We also add support for _unbinding_ keybindings that might exist in the `defaults.json`, but the user doesn't want to be bound to anything. 8. We add support for _hiding_ a profile, which is useful if a user doesn't want one of the default profiles to appear in the list of profiles. ## TODO: * [x] Still need to make Alt+Click work on the settings button * [x] Need to write some user documentation on how the new settings model works * [x] Fix the pair of tests I broke (re: Duplicate profiles) <hr> * Create profiles by layering them * Update test to layer multiple times on the same profile * Add support for layering an array of profiles, but break a couple tests * Add a defaults.json to the package * Layer colorschemes * Moves tests into individual classes * adds support for layering a colorscheme on top of another * Layer an array of color schemes * oh no, this was missed with #2481 must have committed without staging this change, uh oh. Not like those tests actually work so nbd * Layer keybindings * Read settings from defaults.json + profiles.json, layer appropriately This is like 80% of #754. Needs tests. * Add tests for keybindings * add support to unbind a key with `null` or `"unbound"` or `"garbage"` * Layer or clear optional properties * Add a helper to get an optional variable for a bunch of different types In the end, I think we need to ask _was this worth it_ * Do this with the stretch mode too * Add back in the GUID check for profiles * Add some tests for global settings layering * M A D W I T H P O W E R Add a MsBuild target to auto-generate a header with the defaults.json as a string in the file. That way, we can _always_ load the defaults. Literally impossible to not. * When the user's profile.json doesn't exist, create it from a template * Re-order profiles to match the order set in the user's profiles.json * Add tests for re-ordering profiles to match user ordering * Add support for hiding profiles using `"hidden": true` * Use the hardcoded defaults.json for the exception->"use defaults" case * Somehow I messed up the git submodules? * woo documentation * Fix a Terminal.App.Unit.Tests failure * signed/unsigned is hard * Use Alt+Settings button to open the default settings * Missed a signed/unsigned * Some very preliminary PR feedback * More PR feedback Use the wil helper for the exe path Move jsonutils into their own file kill some dead code * Add templates to these bois * remove some code for generating defaults, reorder defaults.json a tad * Make guid a std::optional * Large block of PR feedback * Remove some dead code * add some comments * tag some todos * stl is love, stl is life * add `-noprofile` * Fix the crash that dustin found * -Encoding ASCII * Set a profile's default scheme to Campbell * Fix the tests I regressed * Update UsingJsonSetting.md to reflect that changes from these PRs * Change how GenerateGuidForProfile works * Make AppKeyBindings do its own serialization * Remove leftover dead code from the previous commit * Fix up an enormous number of PR nits * Fix a typo; Update the defaults to match #2378 * Tiny nits * Some typos, PR nits * Fix this broken defaults case
2019-09-16 12:57:10 -07:00
`http://open.esa.int/files/2017/03/Mayer_and_Bond_craters_seen_by_SMART-1-350x346.jpg`
The start of some User docs (#1577) * Start User docs * Fix typos * Addded some more TODO * Update doc/user-docs/index.md Co-Authored-By: Michael Niksa <miniksa@microsoft.com> * Update doc/user-docs/index.md Co-Authored-By: Michael Niksa <miniksa@microsoft.com> * Update doc/user-docs/index.md Co-Authored-By: Michael Niksa <miniksa@microsoft.com> * Update doc/user-docs/index.md Co-Authored-By: Michael Niksa <miniksa@microsoft.com> * Updated from suggestions in the PR * Improve path to profiles.json * Added some details about Json settings * Example Json settings, and a #TODO * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/UsingJsonSettings.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * Update doc/user-docs/index.md Co-Authored-By: Kayla Cinnamon <48369326+cinnamon-msft@users.noreply.github.com> * After review and make colour US. 1. Merged in comments from PR 2. Made colour color :-( 3. Other tidy ups * Added more detais about background images * Remove some TODO comments and minot tidy up * Get rid of TODO 1. Some notes abouet cut and paste -- needs more work 2. Get rid of TODO -- replace with links to issues 3. Add some extra notes about URI for background images
2019-07-09 04:17:19 +10:00
2. Local file location such as `C:\Users\Public\Pictures\openlogo.jpg`
Add Cascading User + Default Settings (#2515) This PR represents the start of the work on Cascading User + default settings, #754. Cascading settings will be done in two parts: * [ ] Layered Default+User settings (this PR) * [ ] Dynamic Profile Generation (#2603). Until _both_ are done, _neither are going in. The dynamic profiles PR will target this PR when it's ready, but will go in as a separate commit into master. This PR covers adding one primary feature: the settings are now in two separate files: * a static `defaults.json` that ships with the package (the "default settings") * a `profiles.json` with the user's customizations (the "user settings) User settings are _layered_ upon the settings in the defaults settings. ## References Other things that might be related here: * #1378 - This seems like it's definitely fixed. The default keybindings are _much_ cleaner, and without the save-on-load behavior, the user's keybindings will be left in a good state * #1398 - This might have honestly been solved by #2475 ## PR Checklist * [x] Closes #754 * [x] Closes #1378 * [x] Closes #2566 * [x] I work here * [x] Tests added/passed * [x] Requires documentation to be updated - it **ABSOLUTELY DOES** ## Detailed Description of the Pull Request / Additional comments 1. We start by taking all of the `FromJson` functions in Profile, ColorScheme, Globals, etc, and converting them to `LayerJson` methods. These are effectively the same, with the change that instead of building a new object, they are simply layering the values on top of `this` object. 2. Next, we add tests for layering properties like that. 3. Now, we add a `defaults.json` to the package. This is the file the users can refer to as our default settings. 4. We then take that `defaults.json` and stamp it into an auto generated `.h` file, so we can use it's data without having to worry about reading it from disk. 5. We then change the `LoadAll` function in `CascadiaSettings`. Now, the function does two loads - one from the defaults, and then a second load from the `profiles.json` file, layering the settings from each source upon the previous values. 6. If the `profiles.json` file doesn't exist, we'll create it from a hardcoded `userDefaults.json`, which is stamped in similar to how `defaults.json` is. 7. We also add support for _unbinding_ keybindings that might exist in the `defaults.json`, but the user doesn't want to be bound to anything. 8. We add support for _hiding_ a profile, which is useful if a user doesn't want one of the default profiles to appear in the list of profiles. ## TODO: * [x] Still need to make Alt+Click work on the settings button * [x] Need to write some user documentation on how the new settings model works * [x] Fix the pair of tests I broke (re: Duplicate profiles) <hr> * Create profiles by layering them * Update test to layer multiple times on the same profile * Add support for layering an array of profiles, but break a couple tests * Add a defaults.json to the package * Layer colorschemes * Moves tests into individual classes * adds support for layering a colorscheme on top of another * Layer an array of color schemes * oh no, this was missed with #2481 must have committed without staging this change, uh oh. Not like those tests actually work so nbd * Layer keybindings * Read settings from defaults.json + profiles.json, layer appropriately This is like 80% of #754. Needs tests. * Add tests for keybindings * add support to unbind a key with `null` or `"unbound"` or `"garbage"` * Layer or clear optional properties * Add a helper to get an optional variable for a bunch of different types In the end, I think we need to ask _was this worth it_ * Do this with the stretch mode too * Add back in the GUID check for profiles * Add some tests for global settings layering * M A D W I T H P O W E R Add a MsBuild target to auto-generate a header with the defaults.json as a string in the file. That way, we can _always_ load the defaults. Literally impossible to not. * When the user's profile.json doesn't exist, create it from a template * Re-order profiles to match the order set in the user's profiles.json * Add tests for re-ordering profiles to match user ordering * Add support for hiding profiles using `"hidden": true` * Use the hardcoded defaults.json for the exception->"use defaults" case * Somehow I messed up the git submodules? * woo documentation * Fix a Terminal.App.Unit.Tests failure * signed/unsigned is hard * Use Alt+Settings button to open the default settings * Missed a signed/unsigned * Some very preliminary PR feedback * More PR feedback Use the wil helper for the exe path Move jsonutils into their own file kill some dead code * Add templates to these bois * remove some code for generating defaults, reorder defaults.json a tad * Make guid a std::optional * Large block of PR feedback * Remove some dead code * add some comments * tag some todos * stl is love, stl is life * add `-noprofile` * Fix the crash that dustin found * -Encoding ASCII * Set a profile's default scheme to Campbell * Fix the tests I regressed * Update UsingJsonSetting.md to reflect that changes from these PRs * Change how GenerateGuidForProfile works * Make AppKeyBindings do its own serialization * Remove leftover dead code from the previous commit * Fix up an enormous number of PR nits * Fix a typo; Update the defaults to match #2378 * Tiny nits * Some typos, PR nits * Fix this broken defaults case
2019-09-16 12:57:10 -07:00
### Adding Copy and Paste Keybindings
Add Cascading User + Default Settings (#2515) This PR represents the start of the work on Cascading User + default settings, #754. Cascading settings will be done in two parts: * [ ] Layered Default+User settings (this PR) * [ ] Dynamic Profile Generation (#2603). Until _both_ are done, _neither are going in. The dynamic profiles PR will target this PR when it's ready, but will go in as a separate commit into master. This PR covers adding one primary feature: the settings are now in two separate files: * a static `defaults.json` that ships with the package (the "default settings") * a `profiles.json` with the user's customizations (the "user settings) User settings are _layered_ upon the settings in the defaults settings. ## References Other things that might be related here: * #1378 - This seems like it's definitely fixed. The default keybindings are _much_ cleaner, and without the save-on-load behavior, the user's keybindings will be left in a good state * #1398 - This might have honestly been solved by #2475 ## PR Checklist * [x] Closes #754 * [x] Closes #1378 * [x] Closes #2566 * [x] I work here * [x] Tests added/passed * [x] Requires documentation to be updated - it **ABSOLUTELY DOES** ## Detailed Description of the Pull Request / Additional comments 1. We start by taking all of the `FromJson` functions in Profile, ColorScheme, Globals, etc, and converting them to `LayerJson` methods. These are effectively the same, with the change that instead of building a new object, they are simply layering the values on top of `this` object. 2. Next, we add tests for layering properties like that. 3. Now, we add a `defaults.json` to the package. This is the file the users can refer to as our default settings. 4. We then take that `defaults.json` and stamp it into an auto generated `.h` file, so we can use it's data without having to worry about reading it from disk. 5. We then change the `LoadAll` function in `CascadiaSettings`. Now, the function does two loads - one from the defaults, and then a second load from the `profiles.json` file, layering the settings from each source upon the previous values. 6. If the `profiles.json` file doesn't exist, we'll create it from a hardcoded `userDefaults.json`, which is stamped in similar to how `defaults.json` is. 7. We also add support for _unbinding_ keybindings that might exist in the `defaults.json`, but the user doesn't want to be bound to anything. 8. We add support for _hiding_ a profile, which is useful if a user doesn't want one of the default profiles to appear in the list of profiles. ## TODO: * [x] Still need to make Alt+Click work on the settings button * [x] Need to write some user documentation on how the new settings model works * [x] Fix the pair of tests I broke (re: Duplicate profiles) <hr> * Create profiles by layering them * Update test to layer multiple times on the same profile * Add support for layering an array of profiles, but break a couple tests * Add a defaults.json to the package * Layer colorschemes * Moves tests into individual classes * adds support for layering a colorscheme on top of another * Layer an array of color schemes * oh no, this was missed with #2481 must have committed without staging this change, uh oh. Not like those tests actually work so nbd * Layer keybindings * Read settings from defaults.json + profiles.json, layer appropriately This is like 80% of #754. Needs tests. * Add tests for keybindings * add support to unbind a key with `null` or `"unbound"` or `"garbage"` * Layer or clear optional properties * Add a helper to get an optional variable for a bunch of different types In the end, I think we need to ask _was this worth it_ * Do this with the stretch mode too * Add back in the GUID check for profiles * Add some tests for global settings layering * M A D W I T H P O W E R Add a MsBuild target to auto-generate a header with the defaults.json as a string in the file. That way, we can _always_ load the defaults. Literally impossible to not. * When the user's profile.json doesn't exist, create it from a template * Re-order profiles to match the order set in the user's profiles.json * Add tests for re-ordering profiles to match user ordering * Add support for hiding profiles using `"hidden": true` * Use the hardcoded defaults.json for the exception->"use defaults" case * Somehow I messed up the git submodules? * woo documentation * Fix a Terminal.App.Unit.Tests failure * signed/unsigned is hard * Use Alt+Settings button to open the default settings * Missed a signed/unsigned * Some very preliminary PR feedback * More PR feedback Use the wil helper for the exe path Move jsonutils into their own file kill some dead code * Add templates to these bois * remove some code for generating defaults, reorder defaults.json a tad * Make guid a std::optional * Large block of PR feedback * Remove some dead code * add some comments * tag some todos * stl is love, stl is life * add `-noprofile` * Fix the crash that dustin found * -Encoding ASCII * Set a profile's default scheme to Campbell * Fix the tests I regressed * Update UsingJsonSetting.md to reflect that changes from these PRs * Change how GenerateGuidForProfile works * Make AppKeyBindings do its own serialization * Remove leftover dead code from the previous commit * Fix up an enormous number of PR nits * Fix a typo; Update the defaults to match #2378 * Tiny nits * Some typos, PR nits * Fix this broken defaults case
2019-09-16 12:57:10 -07:00
As of [#1093](https://github.com/microsoft/terminal/pull/1093) (first available
in Windows Terminal v0.3), the Windows Terminal now supports copy and paste
keyboard shortcuts. However, if you installed and ran the terminal before that,
you won't automatically get the new keybindings added to your settings. If you'd
like to add shortcuts for copy and paste, you can do so by inserting the
following objects into your `globals.keybindings` array:
```json
{ "command": "copy", "keys": ["ctrl+shift+c"] },
{ "command": "paste", "keys": ["ctrl+shift+v"] }
```
> 👉 **Note**: you can also add a keybinding for the `copy` command with the argument `"trimWhitespace": true`. This removes newlines as the text is copied to your clipboard.
This will add copy and paste on <kbd>ctrl+shift+c</kbd>
and <kbd>ctrl+shift+v</kbd> respectively.
You can set the keybindings to whatever you'd like. If you prefer
<kbd>ctrl+c</kbd> to copy, then set the `keys` to `"ctrl+c"`.
You can even set multiple keybindings for a single action if you'd like. For example:
```json
{
"command" : "paste",
"keys" :
[
"ctrl+shift+v"
]
},
{
"command" : "paste",
"keys" :
[
"shift+insert"
]
}
```
will bind both <kbd>ctrl+shift+v</kbd> and
<kbd>shift+Insert</kbd> to `paste`.
> 👉 **Note**: If you set your copy keybinding to `"ctrl+c"`, you'll only be able to send
Add Cascading User + Default Settings (#2515) This PR represents the start of the work on Cascading User + default settings, #754. Cascading settings will be done in two parts: * [ ] Layered Default+User settings (this PR) * [ ] Dynamic Profile Generation (#2603). Until _both_ are done, _neither are going in. The dynamic profiles PR will target this PR when it's ready, but will go in as a separate commit into master. This PR covers adding one primary feature: the settings are now in two separate files: * a static `defaults.json` that ships with the package (the "default settings") * a `profiles.json` with the user's customizations (the "user settings) User settings are _layered_ upon the settings in the defaults settings. ## References Other things that might be related here: * #1378 - This seems like it's definitely fixed. The default keybindings are _much_ cleaner, and without the save-on-load behavior, the user's keybindings will be left in a good state * #1398 - This might have honestly been solved by #2475 ## PR Checklist * [x] Closes #754 * [x] Closes #1378 * [x] Closes #2566 * [x] I work here * [x] Tests added/passed * [x] Requires documentation to be updated - it **ABSOLUTELY DOES** ## Detailed Description of the Pull Request / Additional comments 1. We start by taking all of the `FromJson` functions in Profile, ColorScheme, Globals, etc, and converting them to `LayerJson` methods. These are effectively the same, with the change that instead of building a new object, they are simply layering the values on top of `this` object. 2. Next, we add tests for layering properties like that. 3. Now, we add a `defaults.json` to the package. This is the file the users can refer to as our default settings. 4. We then take that `defaults.json` and stamp it into an auto generated `.h` file, so we can use it's data without having to worry about reading it from disk. 5. We then change the `LoadAll` function in `CascadiaSettings`. Now, the function does two loads - one from the defaults, and then a second load from the `profiles.json` file, layering the settings from each source upon the previous values. 6. If the `profiles.json` file doesn't exist, we'll create it from a hardcoded `userDefaults.json`, which is stamped in similar to how `defaults.json` is. 7. We also add support for _unbinding_ keybindings that might exist in the `defaults.json`, but the user doesn't want to be bound to anything. 8. We add support for _hiding_ a profile, which is useful if a user doesn't want one of the default profiles to appear in the list of profiles. ## TODO: * [x] Still need to make Alt+Click work on the settings button * [x] Need to write some user documentation on how the new settings model works * [x] Fix the pair of tests I broke (re: Duplicate profiles) <hr> * Create profiles by layering them * Update test to layer multiple times on the same profile * Add support for layering an array of profiles, but break a couple tests * Add a defaults.json to the package * Layer colorschemes * Moves tests into individual classes * adds support for layering a colorscheme on top of another * Layer an array of color schemes * oh no, this was missed with #2481 must have committed without staging this change, uh oh. Not like those tests actually work so nbd * Layer keybindings * Read settings from defaults.json + profiles.json, layer appropriately This is like 80% of #754. Needs tests. * Add tests for keybindings * add support to unbind a key with `null` or `"unbound"` or `"garbage"` * Layer or clear optional properties * Add a helper to get an optional variable for a bunch of different types In the end, I think we need to ask _was this worth it_ * Do this with the stretch mode too * Add back in the GUID check for profiles * Add some tests for global settings layering * M A D W I T H P O W E R Add a MsBuild target to auto-generate a header with the defaults.json as a string in the file. That way, we can _always_ load the defaults. Literally impossible to not. * When the user's profile.json doesn't exist, create it from a template * Re-order profiles to match the order set in the user's profiles.json * Add tests for re-ordering profiles to match user ordering * Add support for hiding profiles using `"hidden": true` * Use the hardcoded defaults.json for the exception->"use defaults" case * Somehow I messed up the git submodules? * woo documentation * Fix a Terminal.App.Unit.Tests failure * signed/unsigned is hard * Use Alt+Settings button to open the default settings * Missed a signed/unsigned * Some very preliminary PR feedback * More PR feedback Use the wil helper for the exe path Move jsonutils into their own file kill some dead code * Add templates to these bois * remove some code for generating defaults, reorder defaults.json a tad * Make guid a std::optional * Large block of PR feedback * Remove some dead code * add some comments * tag some todos * stl is love, stl is life * add `-noprofile` * Fix the crash that dustin found * -Encoding ASCII * Set a profile's default scheme to Campbell * Fix the tests I regressed * Update UsingJsonSetting.md to reflect that changes from these PRs * Change how GenerateGuidForProfile works * Make AppKeyBindings do its own serialization * Remove leftover dead code from the previous commit * Fix up an enormous number of PR nits * Fix a typo; Update the defaults to match #2378 * Tiny nits * Some typos, PR nits * Fix this broken defaults case
2019-09-16 12:57:10 -07:00
an interrupt to the commandline application using <kbd>Ctrl+C</kbd> when there's
no text selection. Additionally, if you set `paste` to `"ctrl+v"`, commandline
applications won't be able to read a ctrl+v from the input. For these reasons,
we suggest `"ctrl+shift+c"` and `"ctrl+shift+v"`
### Setting the `startingDirectory` of WSL Profiles to `~`
By default, the `startingDirectory` of a profile is `%USERPROFILE%`
(`C:\Users\<YourUsername>`). This is a Windows path. However, for WSL, you might
want to use the WSL home path instead. At the time of writing (26decf1 / Nov.
1st, 2019), `startingDirectory` only accepts a Windows-style path, so setting it
to start within the WSL distro can be a little tricky.
Fortunately, with Windows 1903, the filesystems of WSL distros can easily be
addressed using the `\\wsl$\` prefix. For any WSL distro whose name is
`DistroName`, you can use `\\wsl$\DistroName` as a Windows path that points to
the root of that distro's filesystem.
For example, the following works as a profile to launch the "Ubuntu-18.04"
distro in it's home path:
```json
{
"name": "Ubuntu-18.04",
"commandline" : "wsl -d Ubuntu-18.04",
"startingDirectory" : "//wsl$/Ubuntu-18.04/home/<Your Ubuntu Username>",
}
```