Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build/pipelines/templates/check-formatting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
clean: true

- task: PowerShell@2
displayName: 'Code Formattting Check'
displayName: 'Code Formatting Check'
inputs:
targetType: filePath
filePath: '.\build\scripts\Invoke-FormattingCheck.ps1'
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ Other terminal emulators like ConEmu have a similar feature.

### `TerminalControl` Changes

* As the decision as to whether to close a terminal control hosting a connection that has transitioned into a terminal state will be made by the application, the unexpressive `Close` event will be removed and replaced with a `ConnectionStateChanged` event.
* As the decision as to whether to close a terminal control hosting a connection that has transitioned into a terminal state will be made by the application, the inexpressive `Close` event will be removed and replaced with a `ConnectionStateChanged` event.
* `event ConnectionStateChanged(TerminalControl, IInspectable)` event will project its connection's `StateChanged` event.
* TerminalControl's new `ConnectionState` will project its connection's `State`.
* (this is indicated for an eventual data binding; see Future Considerations.)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -549,14 +549,14 @@ itself, we'll use `\;` as an escaped `;` within the commandline. This is an area
we've been caught in before, so extensive testing will be necessary to make sure
this works as expected.

Painfully, powershell uses `;` as a separator between commands as well. So, if
someone wanted to call a `wt` commandline in powershell with multiple commands,
the user would need to also escape those semicolons for powershell first. That
Painfully, PowerShell uses `;` as a separator between commands as well. So, if
someone wanted to call a `wt` commandline in PowerShell with multiple commands,
the user would need to also escape those semicolons for PowerShell first. That
means a command like ```wt new-tab ; split-pane``` would need to be ```wt new-tab
`; split-pane``` in powershell, and ```wt new-tab ; split-pane commandline \; with
`; split-pane``` in PowerShell, and ```wt new-tab ; split-pane commandline \; with
\; semicolons``` would need to become ```wt new-tab `; split-pane commandline \`;
with \`; semicolons```, using ```\`;``` to first escape the semicolon for
powershell, then the backslash to escape it for `wt`.
PowerShell, then the backslash to escape it for `wt`.

Alternatively, the user could choose to escape the semicolons with quotes
(either single or double), like so: ```wt new-tab ';' split-pane "commandline \;
Expand Down
34 changes: 17 additions & 17 deletions doc/specs/#754 - Cascading Default Settings.md
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ class IDynamicProfileGenerator
```

For example, the WSL generator would return `Microsoft.Terminal.WSL`. The
Powershell Core generator would return `Microsoft.Terminal.PowershellCore`.
PowerShell Core generator would return `Microsoft.Terminal.PowershellCore`.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
PowerShell Core generator would return `Microsoft.Terminal.PowershellCore`.
PowerShell Core generator would return `Microsoft.Terminal.PowerShellCore`.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You probably don't want that extra blank line. GitHub changed the default behavior of suggestion such that on average suggestions include one -- fairly annoying.

We'll use these names to be able to generate uuidv5 GUIDs that will be unique
(so long as the names are unique).

Expand Down Expand Up @@ -370,28 +370,28 @@ It's not the responsibility of the dynamic profile generator to fill in the
through and fill in the guid for the generated profiles given the generator's
namespace GUID.

### Powershell Core & the Defaults
### PowerShell Core & the Defaults

How do we handle the potential existence of Powershell Core in this model?
Powershell core is unique as far as the default profiles goes - it may or may
How do we handle the potential existence of PowerShell Core in this model?
PowerShell core is unique as far as the default profiles goes - it may or may
not exist on the user's system. Not only that, but depending on the user's
install of Powershell Core, it might have a path in either `Program Files` or
install of PowerShell Core, it might have a path in either `Program Files` or
`Program Files(x86)`.

Additionally, if it _is_ installed, we set it as the default profile instead of
Windows Powershell.
Windows PowerShell.

Powershell core acts much like a dynamic profile. It has an installation source
PowerShell core acts much like a dynamic profile. It has an installation source
that may or not be there. So we'll add a dynamic profile generator for
Powershell Core. This will automatically create a profile for Powershell Core if
PowerShell Core. This will automatically create a profile for PowerShell Core if
necessary.

Unlike the other dynamic profiles, if Powershell Core is present on
Unlike the other dynamic profiles, if PowerShell Core is present on
_first_ launch of the terminal, we set that as the default profile. This can
still be done - we'll need to do some special-case work when we're loading the
user settings and we _don't_ find any existing settings. When that happens,
we'll generate all the default user settings. Before we commit them, we'll check
if the Powershell Core profile exists, and if it does, we'll set that as the
if the PowerShell Core profile exists, and if it does, we'll set that as the
default profile before writing the settings to disk.

### Unbinding a Keybinding
Expand Down Expand Up @@ -432,7 +432,7 @@ it's first generated, taking all the above points into consideration.
"guid": "{6239a42c-1de4-49a3-80bd-e8fdd045185c}"
},
{
// Make changes here to the Windows Powershell profile
// Make changes here to the Windows PowerShell profile
"guid": "{086a83cd-e4ef-418b-89b1-3f6523ff9195}",
},
{
Expand All @@ -455,7 +455,7 @@ it's first generated, taking all the above points into consideration.
Note the following:
* cmd.exe and powershell.exe are both in the file, as to give users an easy
point to extend the settings for those default profiles.
* Powershell Core is included in the file, and the default profile has been set
* PowerShell Core is included in the file, and the default profile has been set
to its GUID. The `source` has been set, indicating that it came from a dynamic profile source.
* There are a few helpful comments scattered throughout the file to help point
the user in the right direction.
Expand Down Expand Up @@ -620,20 +620,20 @@ the `profiles.json` file. Fortunately though, users should be able to remove
much of the boilerplate from their `profiles.json` files, and trim it down just
to their modifications.

#### Migrating Powershell Core
#### Migrating PowerShell Core

Right now, default-generated Powershell Core profiles exist with a stable guid
we've generated for them. However, when we move Powershell Core to being a
Right now, default-generated PowerShell Core profiles exist with a stable guid
we've generated for them. However, when we move PowerShell Core to being a
dynamically generated profile, we'll have to ensure that we don't create a
duplicated "dynamic" entry for that profile. If we want to convert the existing
Powershell Core profiles into a dynamic profile, we'll need to make sure to add
PowerShell Core profiles into a dynamic profile, we'll need to make sure to add
a `source` key to the profile. Everything else in the profile can remain the
same. Once the `source` is added, we'll know to treat it as a dynamic profile,
and it'll respond dynamically.

This is actually something that will automatically be covered by the scenario
mentioned above in "Profiles with the same `guid` as a dynamic profile but not
the same `source`". When we encounter the existing Powershell Core profiles that
the same `source`". When we encounter the existing PowerShell Core profiles that
don't have a `source`, we'll automatically think they're the dynamically
generated ones, and auto-migrate them.

Expand Down
2 changes: 1 addition & 1 deletion doc/user-docs/UsingJsonSettings.md
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ The runtime settings are actually constructed from _three_ sources:
* 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
* Dynamic Profiles, which are generated at runtime. These include PowerShell
Core, the Azure Cloud Shell connector, and profiles for and WSL distros.
* The user settings from `profiles.json`.

Expand Down
2 changes: 1 addition & 1 deletion src/buffer/out/OutputCellView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ bool OutputCellView::operator==(const OutputCellView& it) const noexcept
// Arguments:
// - it - Other view to compare tot his one.
// Return Value:
// - True if any contents or references are inequal. False if they're all equal.
// - True if any contents or references are unequal. False if they're all equal.
bool OutputCellView::operator!=(const OutputCellView& it) const noexcept
{
return !(*this == it);
Expand Down
2 changes: 1 addition & 1 deletion src/buffer/out/TextColor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ void TextColor::SetColor(const COLORREF rgbColor) noexcept
// Method Description:
// - Sets this TextColor to be a legacy-style index into the color table.
// Arguments:
// - index: the index of the colortable we should use for this TextColor.
// - index: the index of the color table we should use for this TextColor.
// Return Value:
// - <none>
void TextColor::SetIndex(const BYTE index) noexcept
Expand Down
2 changes: 1 addition & 1 deletion src/cascadia/TerminalApp/AppCommandlineArgs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@ std::vector<Commandline> AppCommandlineArgs::BuildCommands(const std::vector<con
// Check the string for a delimiter.
// * If there isn't a delimiter, add the arg to the current commandline.
// * If there is a delimiter, split the string at that delimiter. Add the
// first part of the string to the current command, ansd start a new
// first part of the string to the current command, and start a new
// command with the second bit.
for (const auto& arg : args)
{
Expand Down
4 changes: 2 additions & 2 deletions src/cascadia/TerminalApp/CascadiaSettingsSerialization.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,10 +113,10 @@ std::unique_ptr<CascadiaSettings> CascadiaSettings::LoadAll()
// Make sure there's a $schema at the top of the file.
needToWriteFile = resultPtr->_PrependSchemaDirective() || needToWriteFile;

// TODO:GH#2721 If powershell core is installed, we need to set that to the
// TODO:GH#2721 If PowerShell Core is installed, we need to set that to the
// default profile, but only when the settings file was newly created. We'll
// re-write the segment of the user settings for "default profile" to have
// the powershell core GUID instead.
// the PowerShell core GUID instead.

// If we created the file, or found new dynamic profiles, write the user
// settings string back to the file.
Expand Down
2 changes: 1 addition & 1 deletion src/cascadia/TerminalApp/DefaultProfileUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Licensed under the MIT license.
- This header stores our default namespace guid. This is used in the creation of
default and in-box dynamic profiles. It also provides a helper function for
creating a "default" profile. Prior to GH#754, this was used to create the
cmd, powershell, wsl, pwsh, and azure profiles. Now, this helper is used for
cmd, PowerShell, wsl, pwsh, and azure profiles. Now, this helper is used for
any of the in-box dynamic profile generators.

Author(s):
Expand Down
4 changes: 2 additions & 2 deletions src/cascadia/TerminalApp/GlobalAppSettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -514,9 +514,9 @@ std::wstring_view GlobalAppSettings::_SerializeTabWidthMode(const TabViewWidthMo
}

// Method Description:
// - Adds the given colorscheme to our map of schemes, using its name as the key.
// - Adds the given ColorScheme to our map of schemes, using its name as the key.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't believe this needs to be capitalized as the object name. I think the generic "color scheme" terminology was sufficient.

// Arguments:
// - scheme: the color scheme to add
// - scheme: the ColorScheme to add
// Return Value:
// - <none>
void GlobalAppSettings::AddColorScheme(ColorScheme scheme)
Expand Down
20 changes: 10 additions & 10 deletions src/cascadia/TerminalApp/PowershellCoreProfileGenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ namespace
// They are ordered such that the "most important" flags have the largest
// impact on the sort space. For example, since we want Preview to be very polar
// we give it the highest flag value.
// The "ideal" powershell instance has 0 flags (stable, native, Program Files location)
// The "ideal" PowerShell instance has 0 flags (stable, native, Program Files location)
//
// With this ordering, the sort space ends up being (for PowerShell 6)
// (numerically greater values are on the left; this is flipped in the final sort)
Expand Down Expand Up @@ -82,7 +82,7 @@ namespace
}

// Method Description:
// - Generates a name, based on flags, for a powershell instance.
// - Generates a name, based on flags, for a PowerShell instance.
// Return value:
// - the name
std::wstring Name() const
Expand Down Expand Up @@ -137,7 +137,7 @@ namespace
using namespace ::TerminalApp;

// Function Description:
// - Finds all powershell instances with the traditional layout under a directory.
// - Finds all PowerShell instances with the traditional layout under a directory.
// - The "traditional" directory layout requires that pwsh.exe exist in a versioned directory, as in
// ROOT\6\pwsh.exe
// Arguments:
Expand Down Expand Up @@ -190,7 +190,7 @@ catch (...)
}

// Function Description:
// - Finds all powershell instances that have App Execution Aliases in the standard location
// - Finds all PowerShell instances that have App Execution Aliases in the standard location
// Arguments:
// - out: the list into which to accumulate these instances.
static void _accumulateStorePowerShellInstances(std::vector<PowerShellInstance>& out)
Expand All @@ -207,7 +207,7 @@ static void _accumulateStorePowerShellInstances(std::vector<PowerShellInstance>&

if (std::filesystem::exists(appExecAliasPath))
{
// App execution aliases for preview powershell
// App execution aliases for preview PowerShell
const auto previewPath = appExecAliasPath / POWERSHELL_PREVIEW_PFN;
if (std::filesystem::exists(previewPath))
{
Expand All @@ -221,7 +221,7 @@ static void _accumulateStorePowerShellInstances(std::vector<PowerShellInstance>&
}
}

// App execution aliases for stable powershell
// App execution aliases for stable PowerShell
const auto gaPath = appExecAliasPath / POWERSHELL_PFN;
if (std::filesystem::exists(gaPath))
{
Expand All @@ -239,8 +239,8 @@ static void _accumulateStorePowerShellInstances(std::vector<PowerShellInstance>&
}

// Function Description:
// - Finds a powershell instance that's just a pwsh.exe in a folder.
// - This function cannot determine the version number of such a powershell instance.
// - Finds a PowerShell instance that's just a pwsh.exe in a folder.
// - This function cannot determine the version number of such a PowerShell instance.
// Arguments:
// - directory: the directory under which to search
// - flags: flags to apply to all found instances
Expand All @@ -256,9 +256,9 @@ static void _accumulatePwshExeInDirectory(const std::wstring_view directory, con
}

// Function Description:
// - Builds a comprehensive priority-ordered list of powershell instances.
// - Builds a comprehensive priority-ordered list of PowerShell instances.
// Return value:
// - a comprehensive priority-ordered list of powershell instances.
// - a comprehensive priority-ordered list of PowerShell instances.
static std::vector<PowerShellInstance> _collectPowerShellInstances()
{
std::vector<PowerShellInstance> versions;
Expand Down
2 changes: 1 addition & 1 deletion src/cascadia/TerminalApp/Tab.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ namespace winrt::TerminalApp::implementation
// This is called when the terminal changes its font size or sets it for the first
// time (because when we just create terminal via its ctor it has invalid font size).
// On the latter event, we tell the root pane to resize itself so that its descendants
// (including ourself) can properly snap to character grids. In future, we may also
// (including ourselves) can properly snap to character grids. In future, we may also
// want to do that on regular font changes.
control.FontSizeChanged([this](const int /* fontWidth */,
const int /* fontHeight */,
Expand Down
2 changes: 1 addition & 1 deletion src/cascadia/TerminalApp/TerminalPage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1472,7 +1472,7 @@ namespace winrt::TerminalApp::implementation
fire_and_forget TerminalPage::_LaunchSettings(const bool openDefaults)
{
// This will switch the execution of the function to a background (not
// UI) thread. This is IMPORTANT, because the Windows.Storage API's
// UI) thread. This is IMPORTANT, because the Windows.Storage APIs
// (used for retrieving the path to the file) will crash on the UI
// thread, because the main thread is a STA.
co_await winrt::resume_background();
Expand Down
2 changes: 1 addition & 1 deletion src/cascadia/TerminalCore/TerminalApi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ try
CATCH_LOG_RETURN_FALSE()

// Method Description:
// - Updates the value in the colortable at index tableIndex to the new color
// - Updates the value in the color table at index tableIndex to the new color
// color. color is a COLORREF, format 0x00BBGGRR.
// Arguments:
// - tableIndex: the index of the color table to update.
Expand Down
2 changes: 1 addition & 1 deletion src/cascadia/TerminalCore/TerminalDispatch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ try
CATCH_LOG_RETURN_FALSE()

// Method Description:
// - Sets a single entry of the colortable to a new value
// - Sets a single entry of the color table to a new value
// Arguments:
// - tableIndex: The VT color table index
// - color: The new RGB color value to use.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// This test class creates an in-proc conpty host as well as a Terminal, to
// validate that strings written to the conpty create the same response on the
// terminal end. Tests can be written that validate both the contents of the
// host buffer as well as the terminal buffer. Everytime that
// host buffer as well as the terminal buffer. Every time
// `renderer.PaintFrame()` is called, the tests will validate the expected
// output, and then flush the output of the VtEngine straight to the Terminal.

Expand Down
2 changes: 1 addition & 1 deletion src/cascadia/WindowsTerminal/NonClientIslandWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ int NonClientIslandWindow::_GetResizeHandleHeight() const noexcept
// If there's a taskbar on any side of the monitor, reduce our size
// a little bit on that edge.
//
// Note to future code archeologists:
// Note to future code archaeologists:
// This doesn't seem to work for fullscreen on the primary display.
// However, testing a bunch of other apps with fullscreen modes
// and an auto-hiding taskbar has shown that _none_ of them
Expand Down
4 changes: 2 additions & 2 deletions src/host/consoleInformation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ InputBuffer* const CONSOLE_INFORMATION::GetActiveInputBuffer() const
// - Return the default foreground color of the console. If the settings are
// configured to have a default foreground color (separate from the color
// table), this will return that value. Otherwise it will return the value
// from the colortable corresponding to our default attributes.
// from the color table corresponding to our default attributes.
// Arguments:
// - <none>
// Return Value:
Expand All @@ -229,7 +229,7 @@ COLORREF CONSOLE_INFORMATION::GetDefaultForeground() const noexcept
// - Return the default background color of the console. If the settings are
// configured to have a default background color (separate from the color
// table), this will return that value. Otherwise it will return the value
// from the colortable corresponding to our default attributes.
// from the color table corresponding to our default attributes.
// Arguments:
// - <none>
// Return Value:
Expand Down
2 changes: 1 addition & 1 deletion src/host/directio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -580,7 +580,7 @@ void EventsToUnicode(_Inout_ std::deque<std::unique_ptr<IInputEvent>>& inEvents,
// Arguments:
// - pInputBuffer - the input buffer to write to. Currently unused, as
// HandleGenericKeyEvent just gets the global input buffer, but all
// ConGetSet API's require an input or output object.
// ConGetSet APIs require an input or output object.
// - key - The keyevent to send to the console.
// Return Value:
// - HRESULT indicating success or failure
Expand Down
Loading