Skip to content

Commit

Permalink
Add hidden to the defaults, the userDefaults, and the autogenerated…
Browse files Browse the repository at this point in the history
… stubs (#2801)

Fixes #2795
  • Loading branch information
zadjii-msft authored and DHowett committed Sep 18, 2019
1 parent 95580b5 commit 4b439cf
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 7 deletions.
9 changes: 5 additions & 4 deletions doc/cascadia/SettingsSchema.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ Properties listed below are specific to each unique profile.
| `fontFace` | _Required_ | String | `Consolas` | Name of the font face used in the profile. We will try to fallback to Consolas if this can't be found or is invalid. |
| `fontSize` | _Required_ | Integer | `12` | Sets the font size. |
| `guid` | _Required_ | String | | Unique identifier of the profile. Written in registry format: `"{00000000-0000-0000-0000-000000000000}"`. |
| `hidden` | Optional | Boolean | `false` | If set to true, the profile will not appear in the list of profiles. This can be used to hide default profiles and dynamicially generated profiles, while leaving them in your settings file. |
| `historySize` | _Required_ | Integer | `9001` | The number of lines above the ones displayed in the window you can scroll back to. |
| `name` | _Required_ | String | `PowerShell Core` | Name of the profile. Displays in the dropdown menu. <br>Additionally, this value will be used as the "title" to pass to the shell on startup. Some shells (like `bash`) may choose to ignore this initial value, while others (`cmd`, `powershell`) may use this value over the lifetime of the application. This "title" behavior can be overriden by using `tabTitle`. |
| `padding` | _Required_ | String | `8, 8, 8, 8` | Sets the padding around the text within the window. Can have three different formats: `"#"` sets the same padding for all sides, `"#, #"` sets the same padding for left-right and top-bottom, and `"#, #, #, #"` sets the padding individually for left, top, right, and bottom. |
Expand Down Expand Up @@ -148,20 +149,20 @@ The most useful URI schemes to remember when customizing background images and i
### Icons
Terminal displays icons for each of your profiles which Terminal generates for any built-in shells - PowerShell Core, PowerShell, and any installed Linux/WSL distros. Each profile refers to a stock icon via the `ms-appx` URI Scheme.

> ⚠ Note: Do not rely on the files referenced by the `ms-appx` URI Scheme - they are considered an internal implementation detail and may change name/location or may be omitted in the future.
> ⚠ Note: Do not rely on the files referenced by the `ms-appx` URI Scheme - they are considered an internal implementation detail and may change name/location or may be omitted in the future.
You can refer to you own icons if you wish, e.g.:

```json
```json
"icon" : "C:\\Users\\richturn\\OneDrive\\WindowsTerminal\\icon-ubuntu-32.png",
```

> 👉 Tip: Icons should be sized to 32x32px in an appropriate raster image format (e.g. .PNG, .GIF, or .ICO) to avoid having to scale your icons during runtime (causing a noticeable delay and loss of quality.)
### Custom Background Images
You can apply a background image to each of your profiles, allowing you to configure/brand/style each of your profiles independently from one another if you wish.
You can apply a background image to each of your profiles, allowing you to configure/brand/style each of your profiles independently from one another if you wish.

To do so, specify your preferred `backgroundImage`, position it using `backgroundImageAlignment`, set its opacity with `backgroundImageOpacity`, and/or specify how your image fill the available space using `backgroundImageStretchMode`.
To do so, specify your preferred `backgroundImage`, position it using `backgroundImageAlignment`, set its opacity with `backgroundImageOpacity`, and/or specify how your image fill the available space using `backgroundImageStretchMode`.

For example:
```json
Expand Down
6 changes: 5 additions & 1 deletion src/cascadia/TerminalApp/Profile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,9 @@ Json::Value Profile::ToJson() const
Json::Value root = GenerateStub();

///// Profile-specific settings /////
root[JsonKey(HiddenKey)] = _hidden;
// As of #2795, all profile-specific settings were moved to GenerateStub. If
// any new profiles-specific settings are added, they should probably be
// added here instead of in that method.

///// Core Settings /////
if (_defaultForeground)
Expand Down Expand Up @@ -448,6 +450,8 @@ Json::Value Profile::GenerateStub() const
stub[JsonKey(SourceKey)] = winrt::to_string(_source.value());
}

stub[JsonKey(HiddenKey)] = _hidden;

return stub;
}

Expand Down
2 changes: 2 additions & 0 deletions src/cascadia/TerminalApp/defaults.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"guid": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
"name": "Windows PowerShell",
"commandline": "powershell.exe",
"hidden": false,
"startingDirectory": "%USERPROFILE%",
"background": "#012456",
"closeOnExit": true,
Expand All @@ -33,6 +34,7 @@
"guid": "{0caa0dad-35be-5f56-a8ff-afceeeaa6101}",
"name": "cmd",
"commandline": "cmd.exe",
"hidden": false,
"startingDirectory": "%USERPROFILE%",
"closeOnExit": true,
"colorScheme": "Campbell",
Expand Down
6 changes: 4 additions & 2 deletions src/cascadia/TerminalApp/userDefaults.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,15 @@
// Make changes here to the powershell.exe profile
"guid": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
"name": "Windows PowerShell",
"commandline": "powershell.exe"
"commandline": "powershell.exe",
"hidden": false
},
{
// Make changes here to the cmd.exe profile
"guid": "{0caa0dad-35be-5f56-a8ff-afceeeaa6101}",
"name": "cmd",
"commandline": "cmd.exe"
"commandline": "cmd.exe",
"hidden": false
}
],

Expand Down

0 comments on commit 4b439cf

Please sign in to comment.