Commit graph

19 commits

Author SHA1 Message Date
Josh Soref a13ccfd0f5
Fix a bunch of spelling errors across the project (#4295)
Generated by https://github.com/jsoref/spelling `f`; to maintain your repo, please consider `fchurn`

I generally try to ignore upstream bits. I've accidentally included some items from the `deps/` directory. I expect someone will give me a list of items to drop, I'm happy to drop whole files/directories, or to split the PR into multiple items (E.g. comments/locals/public).

Closes #4294
2020-02-10 20:40:01 +00:00
David Haymond 46b70d824d
doc: correct spelling error in UsingJsonSettings.md (#4518) 2020-02-10 10:43:15 -08:00
Mike Griese 8b2189f6f0 Add a note regarding unbinding keys (#4084) 2019-12-30 10:08:30 -08:00
IBRAHIM SAMAD 6cff0435ae doc: fix a typo in the default settings discussion (#3980)
This change fixed a typo with the grammatical construct in the sentence.
2019-12-17 10:13:28 -08:00
Mike Griese 3ccc999e1f Add support for "User Default" settings II (#3892)
## Summary of the Pull Request

_This is attempt 2 at this feature_. The original PR can be found at #3369. 

These are settings that apply to _every_ profile, before user customizations. 

If the user wants to add "default profile settings", they can make the `"profiles"` property an _object_, instead of a list, and add `"defaults"` key underneath that object. The users list of profiles should then be under the `list` property of the `profiles` object.

## References
#2515, #2603, #3369, #3569

## PR Checklist
* [x] Closes #2325
* [x] I work here
* [x] Tests added/passed
* [x] schema, docs updated

## Detailed Description of the Pull Request / Additional comments
~~Discussion in #2325 itself serves as the "spec" for this task. I thought we'd need more discussion on the topic, but it ended up being pretty straightforward.~~

I should not have said that in the original PR. We've had a better spec review now that I think we're happier with.

## Validation Steps Performed
_ran the tests_
2019-12-11 00:39:29 +00:00
Mike Griese f0c110593a Add a note on using WSL paths to user docs (#3405)
* Add a note on using WSL paths to documentation

Co-Authored-By: greg904 <56923875+greg904@users.noreply.github.com>
Co-Authored-By: Carlos Zamora <carlos.zamora@microsoft.com>
2019-11-06 11:19:43 -08:00
Martin Lopes aa682bfd12 doc: update the path to profiles.json (#3087)
This path is consistently `WindowsTerminal_8wekyb3d8bbwe`.
2019-10-08 10:36:53 -07:00
Mike Griese 23bea9e5b5 doc: add note on dynamic profile GUIDs (#2938) 2019-09-27 14:50:02 -07:00
Carlos Zamora 0df6415e5b
Update Docs on "Copy" Operation (#2799) 2019-09-27 11:07:59 -07:00
Gage Ames b096a57387 Update path to profiles.json in documentation (#2843)
The profiles.json file was moved from RoamingState to LocalState in
PR #2298. Update the documentation to reflect this change.
2019-09-23 09:15:47 -07:00
Mike Griese 8ba8f35dc5
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
Fredi Machado 2da3b49c9e Fix json settings documentation (#2699)
* Fix json settings documentation

The ctrl+c issue was fixed in [#2446](https://github.com/microsoft/terminal/pull/2446)

* Update UsingJsonSettings.md
2019-09-10 16:08:15 -07:00
Paul-00910 6d50fb4d31 doc: More clear path instructions (#2497) 2019-08-21 09:14:55 -07:00
Nathan Metzger d1a3e6d2b8 doc: startingDirectory formatting note (#2415) 2019-08-20 19:16:16 -07:00
MikeTheGreat e92efa5bc0 doc: svg currently doesn't work; using .jpg instead (#2443)
Since the JPG won't stretch nicely we're also going to put it in the top-right corner without any scaling
2019-08-20 16:35:16 -07:00
Mike Griese 13d66c9948
Add info about adding copy/paste keybindings (#2290)
* Add info about adding copy/paste keybindings

* Update doc/user-docs/UsingJsonSettings.md

* Apply suggestions from code review

Co-Authored-By: Dustin L. Howett (MSFT) <duhowett@microsoft.com>
2019-08-13 08:28:04 -05:00
Robert Jordan 89190c6e6c Add support for background image alignment (as one setting) (#1959)
* Implement base background image alignment settings

TerminalSettings now has two new properties:
* BackgroundImageHorizontalAlignment
* BackgroundImageVerticalAlignment

These properties are used in TermControl::_InitializeBackgroundBrush to specify the alignment for TermControl::_bgImageLayer.

This is a base commit that will split into two possible branches:
* Use one setting in profiles.json: "backgroundImageAlignment"
* Use two settings in profiles.json: "backgroundImageHorizontal/VerticalAlignment"

* Implement background image alignment profile setting

Implement background image alignment as one profile setting.
* This has the benefit of acting as a single setting when the user would likely want to change both horizontal and vertical alignment.
* HorizontalAlignment and VerticalAlignment are still stored as a tuple in Profile because they are an optional field. And thus, it would not make sense for one of the alignments to be left unused while the other is not.
* Cons are that the tuple signature is quite long, but it is only used in a small number of locations. The Serialize method is also a little mishapen with the nested switch statements. Empty lines have been added between base-level cases to improve readability.

* Fix capitalization typo for BackgroundImageStretchModeKey

In Profiles.cpp, the key for the image stretch mode json property had a lowercase 'i' in "Backgroundimage", not following proper UpperCamelCase.
The "i" has been capitalized and the two usages of the constant have been updated as well.

* Document Background Image settings

* Adds entries SettingsSchema.md for the original 3 backgroundImage settings in addition to the new backgroundImageAlignment setting.

* Fix setting capitalization error in UsingJsonSettings.md

* The background image example in UsingJsonSettings.md listing a backgroundImageStretchMode of "Fill" has been corrected to "fill".


Fixes #1949.
2019-07-24 21:47:06 -07:00
ksyx fad7638bb3 user docs: Fix the capitalization on “Color Schemes” (#1953) 2019-07-13 11:17:11 -07:00
Alec Clews c9d8e3ee2b 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-08 11:17:19 -07:00