Skip to content

Commit

Permalink
Merge branch 'master' into dev/tabs-color
Browse files Browse the repository at this point in the history
  • Loading branch information
gbaychev committed Feb 15, 2020
2 parents 5e735f8 + 941a44a commit cfeda22
Show file tree
Hide file tree
Showing 232 changed files with 2,648 additions and 2,389 deletions.
15 changes: 12 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,15 @@ Related repositories include:

> 👉 Note: Windows Terminal requires Windows 10 1903 (build 18362) or later
### Manually installing builds from this repository
### Microsoft Store [Recommended]

Install the [Windows Terminal from the Microsoft Store][store-install-link]. This allows you to always be on the latest version when we release new builds with automatic upgrades.

This is our preferred method.

### Other install methods

#### Via GitHub

For users who are unable to install Terminal from the Microsoft Store, Terminal builds can be manually downloaded from this repository's [Releases page](https://github.com/microsoft/terminal/releases).

Expand All @@ -26,7 +34,7 @@ For users who are unable to install Terminal from the Microsoft Store, Terminal
> * Be sure to install the [Desktop Bridge VC++ v14 Redistributable Package](https://www.microsoft.com/en-us/download/details.aspx?id=53175) otherwise Terminal may not install and/or run and may crash at startup
> * Terminal will not auto-update when new builds are released so you will need to regularly install the latest Terminal release to receive all the latest fixes and improvements!
### Install via Chocolatey (unofficial)
#### Via Chocolatey (unofficial)

[Chocolatey](https://chocolatey.org) users can download and install the latest Terminal release by installing the `microsoft-windows-terminal` package:

Expand Down Expand Up @@ -131,7 +139,7 @@ All project documentation is located in the `./doc` folder. If you would like to

We are excited to work alongside you, our amazing community, to build and enhance Windows Terminal\!

***BEFORE you start work on a feature/fix***, please read & follow our [Contributor's Guide](https://github.com/microsoft/terminal/blob/master/contributing.md) to help avoid any wasted or duplicate effort.
***BEFORE you start work on a feature/fix***, please read & follow our [Contributor's Guide](https://github.com/microsoft/terminal/blob/master/CONTRIBUTING.md) to help avoid any wasted or duplicate effort.

## Communicating with the Team

Expand Down Expand Up @@ -219,3 +227,4 @@ For more information see the [Code of Conduct FAQ][conduct-FAQ] or contact [open
[conduct-code]: https://opensource.microsoft.com/codeofconduct/
[conduct-FAQ]: https://opensource.microsoft.com/codeofconduct/faq/
[conduct-email]: mailto:[email protected]
[store-install-link]: https://aka.ms/windowsterminal
2 changes: 1 addition & 1 deletion custom.props
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<XesUseOneStoreVersioning>true</XesUseOneStoreVersioning>
<XesBaseYearForStoreVersion>2020</XesBaseYearForStoreVersion>
<VersionMajor>0</VersionMajor>
<VersionMinor>9</VersionMinor>
<VersionMinor>10</VersionMinor>
<VersionInfoProductName>Windows Terminal</VersionInfoProductName>
</PropertyGroup>
</Project>
Binary file modified res/terminal/images-Dev/LargeTile.scale-100.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified res/terminal/images-Dev/LargeTile.scale-125.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified res/terminal/images-Dev/LargeTile.scale-150.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified res/terminal/images-Dev/LargeTile.scale-200.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified res/terminal/images-Dev/LargeTile.scale-400.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified res/terminal/images-Dev/LockScreenLogo.scale-100.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified res/terminal/images-Dev/LockScreenLogo.scale-125.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified res/terminal/images-Dev/LockScreenLogo.scale-150.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified res/terminal/images-Dev/LockScreenLogo.scale-200.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified res/terminal/images-Dev/LockScreenLogo.scale-400.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified res/terminal/images-Dev/SmallTile.scale-100.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified res/terminal/images-Dev/SmallTile.scale-125.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified res/terminal/images-Dev/SmallTile.scale-150.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified res/terminal/images-Dev/SmallTile.scale-200.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified res/terminal/images-Dev/SmallTile.scale-400.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified res/terminal/images-Dev/SplashScreen.scale-100.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified res/terminal/images-Dev/SplashScreen.scale-125.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified res/terminal/images-Dev/SplashScreen.scale-150.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified res/terminal/images-Dev/SplashScreen.scale-200.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified res/terminal/images-Dev/SplashScreen.scale-400.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified res/terminal/images-Dev/Square150x150Logo.scale-100.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified res/terminal/images-Dev/Square150x150Logo.scale-125.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified res/terminal/images-Dev/Square150x150Logo.scale-150.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified res/terminal/images-Dev/Square150x150Logo.scale-200.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified res/terminal/images-Dev/Square150x150Logo.scale-400.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified res/terminal/images-Dev/Square44x44Logo.scale-100.png
Binary file modified res/terminal/images-Dev/Square44x44Logo.scale-125.png
Binary file modified res/terminal/images-Dev/Square44x44Logo.scale-150.png
Binary file modified res/terminal/images-Dev/Square44x44Logo.scale-200.png
Binary file modified res/terminal/images-Dev/Square44x44Logo.scale-400.png
Binary file modified res/terminal/images-Dev/Square44x44Logo.targetsize-16.png
Binary file modified res/terminal/images-Dev/Square44x44Logo.targetsize-20.png
Binary file modified res/terminal/images-Dev/Square44x44Logo.targetsize-24.png
Binary file modified res/terminal/images-Dev/Square44x44Logo.targetsize-256.png
Binary file modified res/terminal/images-Dev/Square44x44Logo.targetsize-30.png
Binary file modified res/terminal/images-Dev/Square44x44Logo.targetsize-32.png
Binary file modified res/terminal/images-Dev/Square44x44Logo.targetsize-36.png
Binary file modified res/terminal/images-Dev/Square44x44Logo.targetsize-40.png
Binary file modified res/terminal/images-Dev/Square44x44Logo.targetsize-48.png
Binary file modified res/terminal/images-Dev/Square44x44Logo.targetsize-60.png
Binary file modified res/terminal/images-Dev/Square44x44Logo.targetsize-64.png
Binary file modified res/terminal/images-Dev/Square44x44Logo.targetsize-72.png
Binary file modified res/terminal/images-Dev/Square44x44Logo.targetsize-80.png
Binary file modified res/terminal/images-Dev/Square44x44Logo.targetsize-96.png
Binary file modified res/terminal/images-Dev/StoreLogo.scale-100.png
Binary file modified res/terminal/images-Dev/StoreLogo.scale-125.png
Binary file modified res/terminal/images-Dev/StoreLogo.scale-150.png
Binary file modified res/terminal/images-Dev/StoreLogo.scale-200.png
Binary file modified res/terminal/images-Dev/StoreLogo.scale-400.png
Binary file modified res/terminal/images-Dev/Wide310x150Logo.scale-100.png
Binary file modified res/terminal/images-Dev/Wide310x150Logo.scale-125.png
Binary file modified res/terminal/images-Dev/Wide310x150Logo.scale-150.png
Binary file modified res/terminal/images-Dev/Wide310x150Logo.scale-200.png
Binary file modified res/terminal/images-Dev/Wide310x150Logo.scale-400.png
Binary file modified res/terminal/images-Universal/LargeTile.scale-100.png
Binary file modified res/terminal/images-Universal/LargeTile.scale-125.png
Binary file modified res/terminal/images-Universal/LargeTile.scale-150.png
Binary file modified res/terminal/images-Universal/LargeTile.scale-200.png
Binary file modified res/terminal/images-Universal/LargeTile.scale-400.png
Binary file modified res/terminal/images-Universal/LockScreenLogo.scale-100.png
Binary file modified res/terminal/images-Universal/LockScreenLogo.scale-125.png
Binary file modified res/terminal/images-Universal/LockScreenLogo.scale-150.png
Binary file modified res/terminal/images-Universal/LockScreenLogo.scale-200.png
Binary file modified res/terminal/images-Universal/LockScreenLogo.scale-400.png
Binary file modified res/terminal/images-Universal/SmallTile.scale-100.png
Binary file modified res/terminal/images-Universal/SmallTile.scale-125.png
Binary file modified res/terminal/images-Universal/SmallTile.scale-150.png
Binary file modified res/terminal/images-Universal/SmallTile.scale-200.png
Binary file modified res/terminal/images-Universal/SmallTile.scale-400.png
Binary file modified res/terminal/images-Universal/SplashScreen.scale-100.png
Binary file modified res/terminal/images-Universal/SplashScreen.scale-125.png
Binary file modified res/terminal/images-Universal/SplashScreen.scale-150.png
Binary file modified res/terminal/images-Universal/SplashScreen.scale-200.png
Binary file modified res/terminal/images-Universal/SplashScreen.scale-400.png
Binary file modified res/terminal/images-Universal/Square150x150Logo.scale-100.png
Binary file modified res/terminal/images-Universal/Square150x150Logo.scale-125.png
Binary file modified res/terminal/images-Universal/Square150x150Logo.scale-150.png
Binary file modified res/terminal/images-Universal/Square150x150Logo.scale-200.png
Binary file modified res/terminal/images-Universal/Square150x150Logo.scale-400.png
Binary file modified res/terminal/images-Universal/Square44x44Logo.scale-100.png
Binary file modified res/terminal/images-Universal/Square44x44Logo.scale-125.png
Binary file modified res/terminal/images-Universal/Square44x44Logo.scale-150.png
Binary file modified res/terminal/images-Universal/Square44x44Logo.scale-200.png
Binary file modified res/terminal/images-Universal/Square44x44Logo.scale-400.png
Binary file modified res/terminal/images-Universal/Square44x44Logo.targetsize-16.png
Binary file modified res/terminal/images-Universal/Square44x44Logo.targetsize-20.png
Binary file modified res/terminal/images-Universal/Square44x44Logo.targetsize-24.png
Binary file modified res/terminal/images-Universal/Square44x44Logo.targetsize-256.png
Binary file modified res/terminal/images-Universal/Square44x44Logo.targetsize-30.png
Binary file modified res/terminal/images-Universal/Square44x44Logo.targetsize-32.png
Binary file modified res/terminal/images-Universal/Square44x44Logo.targetsize-36.png
Binary file modified res/terminal/images-Universal/Square44x44Logo.targetsize-40.png
Binary file modified res/terminal/images-Universal/Square44x44Logo.targetsize-48.png
Binary file modified res/terminal/images-Universal/Square44x44Logo.targetsize-60.png
Binary file modified res/terminal/images-Universal/Square44x44Logo.targetsize-64.png
Binary file modified res/terminal/images-Universal/Square44x44Logo.targetsize-72.png
Binary file modified res/terminal/images-Universal/Square44x44Logo.targetsize-80.png
Binary file modified res/terminal/images-Universal/Square44x44Logo.targetsize-96.png
Binary file modified res/terminal/images-Universal/StoreLogo.scale-100.png
Binary file modified res/terminal/images-Universal/StoreLogo.scale-125.png
Binary file modified res/terminal/images-Universal/StoreLogo.scale-150.png
Binary file modified res/terminal/images-Universal/StoreLogo.scale-200.png
Binary file modified res/terminal/images-Universal/StoreLogo.scale-400.png
Binary file modified res/terminal/images-Universal/Wide310x150Logo.scale-100.png
Binary file modified res/terminal/images-Universal/Wide310x150Logo.scale-125.png
Binary file modified res/terminal/images-Universal/Wide310x150Logo.scale-150.png
Binary file modified res/terminal/images-Universal/Wide310x150Logo.scale-200.png
Binary file modified res/terminal/images-Universal/Wide310x150Logo.scale-400.png
Binary file modified res/terminal/images-UniversalDev/LargeTile.scale-100.png
Binary file modified res/terminal/images-UniversalDev/LargeTile.scale-125.png
Binary file modified res/terminal/images-UniversalDev/LargeTile.scale-150.png
Binary file modified res/terminal/images-UniversalDev/LargeTile.scale-200.png
Binary file modified res/terminal/images-UniversalDev/LargeTile.scale-400.png
Binary file modified res/terminal/images-UniversalDev/LockScreenLogo.scale-100.png
Binary file modified res/terminal/images-UniversalDev/LockScreenLogo.scale-125.png
Binary file modified res/terminal/images-UniversalDev/LockScreenLogo.scale-150.png
Binary file modified res/terminal/images-UniversalDev/LockScreenLogo.scale-200.png
Binary file modified res/terminal/images-UniversalDev/LockScreenLogo.scale-400.png
Binary file modified res/terminal/images-UniversalDev/SmallTile.scale-100.png
Binary file modified res/terminal/images-UniversalDev/SmallTile.scale-125.png
Binary file modified res/terminal/images-UniversalDev/SmallTile.scale-150.png
Binary file modified res/terminal/images-UniversalDev/SmallTile.scale-200.png
Binary file modified res/terminal/images-UniversalDev/SmallTile.scale-400.png
Binary file modified res/terminal/images-UniversalDev/SplashScreen.scale-100.png
Binary file modified res/terminal/images-UniversalDev/SplashScreen.scale-125.png
Binary file modified res/terminal/images-UniversalDev/SplashScreen.scale-150.png
Binary file modified res/terminal/images-UniversalDev/SplashScreen.scale-200.png
Binary file modified res/terminal/images-UniversalDev/SplashScreen.scale-400.png
Binary file modified res/terminal/images-UniversalDev/Square150x150Logo.scale-100.png
Binary file modified res/terminal/images-UniversalDev/Square150x150Logo.scale-125.png
Binary file modified res/terminal/images-UniversalDev/Square150x150Logo.scale-150.png
Binary file modified res/terminal/images-UniversalDev/Square150x150Logo.scale-200.png
Binary file modified res/terminal/images-UniversalDev/Square150x150Logo.scale-400.png
Binary file modified res/terminal/images-UniversalDev/Square44x44Logo.scale-100.png
Binary file modified res/terminal/images-UniversalDev/Square44x44Logo.scale-125.png
Binary file modified res/terminal/images-UniversalDev/Square44x44Logo.scale-150.png
Binary file modified res/terminal/images-UniversalDev/Square44x44Logo.scale-200.png
Binary file modified res/terminal/images-UniversalDev/Square44x44Logo.scale-400.png
Binary file modified res/terminal/images-UniversalDev/Square44x44Logo.targetsize-16.png
Binary file modified res/terminal/images-UniversalDev/Square44x44Logo.targetsize-20.png
Binary file modified res/terminal/images-UniversalDev/Square44x44Logo.targetsize-24.png
Binary file modified res/terminal/images-UniversalDev/Square44x44Logo.targetsize-30.png
Binary file modified res/terminal/images-UniversalDev/Square44x44Logo.targetsize-32.png
Binary file modified res/terminal/images-UniversalDev/Square44x44Logo.targetsize-36.png
Binary file modified res/terminal/images-UniversalDev/Square44x44Logo.targetsize-40.png
Binary file modified res/terminal/images-UniversalDev/Square44x44Logo.targetsize-48.png
Binary file modified res/terminal/images-UniversalDev/Square44x44Logo.targetsize-60.png
Binary file modified res/terminal/images-UniversalDev/Square44x44Logo.targetsize-64.png
Binary file modified res/terminal/images-UniversalDev/Square44x44Logo.targetsize-72.png
Binary file modified res/terminal/images-UniversalDev/Square44x44Logo.targetsize-80.png
Binary file modified res/terminal/images-UniversalDev/StoreLogo.scale-100.png
Binary file modified res/terminal/images-UniversalDev/StoreLogo.scale-125.png
Binary file modified res/terminal/images-UniversalDev/StoreLogo.scale-150.png
Binary file modified res/terminal/images-UniversalDev/StoreLogo.scale-200.png
Binary file modified res/terminal/images-UniversalDev/StoreLogo.scale-400.png
Binary file modified res/terminal/images-UniversalDev/Wide310x150Logo.scale-100.png
Binary file modified res/terminal/images-UniversalDev/Wide310x150Logo.scale-125.png
Binary file modified res/terminal/images-UniversalDev/Wide310x150Logo.scale-150.png
Binary file modified res/terminal/images-UniversalDev/Wide310x150Logo.scale-200.png
Binary file modified res/terminal/images-UniversalDev/Wide310x150Logo.scale-400.png
2 changes: 1 addition & 1 deletion src/cascadia/TerminalApp/AppKeyBindingsSerialization.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ static const std::map<ShortcutAction, std::function<IActionArgs(const Json::Valu

// Function Description:
// - Small helper to create a json value serialization of a single
// KeyBinding->Action maping. The created object is of schema:
// KeyBinding->Action maping.
// {
// keys:[String],
// command:String
Expand Down
70 changes: 65 additions & 5 deletions src/cascadia/TerminalApp/CascadiaSettingsSerialization.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ static constexpr std::string_view SchemesKey{ "schemes" };
static constexpr std::string_view DisabledProfileSourcesKey{ "disabledProfileSources" };

static constexpr std::string_view Utf8Bom{ u8"\uFEFF" };
static constexpr std::string_view DefaultProfilesIndentation{ " " };
static constexpr std::string_view SettingsSchemaFragment{ "\n"
R"( "$schema": "https://aka.ms/terminal-profiles-schema")" };

Expand All @@ -59,6 +58,11 @@ std::unique_ptr<CascadiaSettings> CascadiaSettings::LoadAll()
{
auto resultPtr = LoadDefaults();

// GH 3588, we need this below to know if the user chose something that wasn't our default.
// Collect it up here in case it gets modified by any of the other layers between now and when
// the user's preferences are loaded and layered.
const auto hardcodedDefaultGuid = resultPtr->GlobalSettings().GetDefaultProfile();

std::optional<std::string> fileData = _ReadUserSettings();
const bool foundFile = fileData.has_value();

Expand Down Expand Up @@ -129,6 +133,57 @@ std::unique_ptr<CascadiaSettings> CascadiaSettings::LoadAll()
// If this throws, the app will catch it and use the default settings
resultPtr->_ValidateSettings();

// GH 3855 - Gathering Data on custom profiles to inform better defaults
// Do it after everything else so it won't happen unless validation passed.
// Also, avoid processing unless someone's listening for measures. The keybindings work, at least,
// is a lot of computation we can skip if no one cares.
if (TraceLoggingProviderEnabled(g_hTerminalAppProvider, 0, MICROSOFT_KEYWORD_MEASURES))
{
auto guid = resultPtr->GlobalSettings().GetDefaultProfile();

// Compare to the defaults.json one that we set on install.
// If it's different, log what the user chose.
if (hardcodedDefaultGuid != guid)
{
TraceLoggingWrite(
g_hTerminalAppProvider, // handle to TerminalApp tracelogging provider
"CustomDefaultProfile",
TraceLoggingDescription("Event emitted when user has chosen a different default profile than hardcoded one on load/reload"),
TraceLoggingGuid(guid, "DefaultProfile", "ID of user-chosen default profile"),
TraceLoggingKeyword(MICROSOFT_KEYWORD_MEASURES),
TelemetryPrivacyDataTag(PDT_ProductAndServiceUsage));
}

// If the user had keybinding settings preferences, we want to learn from them to make better defaults
auto userKeybindings = resultPtr->_userSettings[JsonKey(KeybindingsKey)];
if (!userKeybindings.empty())
{
// If there are custom key bindings, let's understand what they are because maybe the defaults aren't good enough

// Run it through the object so we can parse it apart and then only serialize the fields we're interested in
// and avoid extraneous data.
auto akb = winrt::make_self<implementation::AppKeyBindings>();
akb->LayerJson(userKeybindings);
auto value = akb->ToJson();

// Reserialize the keybindings
Json::StreamWriterBuilder wbuilder;
// Use 4 spaces to indent instead of \t
wbuilder.settings_["indentation"] = " ";
wbuilder.settings_["enableYAMLCompatibility"] = true; // suppress spaces around colons

const auto keybindingsString = Json::writeString(wbuilder, value);

TraceLoggingWrite(
g_hTerminalAppProvider, // handle to TerminalApp tracelogging provider
"CustomKeybindings",
TraceLoggingDescription("Event emitted when custom keybindings are idenfitied on load/reload"),
TraceLoggingUtf8String(keybindingsString.c_str(), "Keybindings", "Keybindings as JSON"),
TraceLoggingKeyword(MICROSOFT_KEYWORD_MEASURES),
TelemetryPrivacyDataTag(PDT_ProductAndServiceUsage));
}
}

return resultPtr;
}

Expand Down Expand Up @@ -358,6 +413,11 @@ bool CascadiaSettings::_AppendDynamicProfilesToUserSettings()
const auto numProfiles = userProfilesObj.size();
const auto lastProfile = userProfilesObj[numProfiles - 1];
size_t currentInsertIndex = lastProfile.getOffsetLimit();
// Find the position of the first non-tab/space character before the last profile...
const auto lastProfileIndentStartsAt{ _userSettingsString.find_last_not_of(" \t", lastProfile.getOffsetStart() - 1) };
// ... and impute the user's preferred indentation.
// (we're taking a copy because a string_view into a string we mutate is a no-no.)
const std::string indentation{ _userSettingsString, lastProfileIndentStartsAt + 1, lastProfile.getOffsetStart() - lastProfileIndentStartsAt - 1 };

bool changedFile = false;

Expand Down Expand Up @@ -388,17 +448,17 @@ bool CascadiaSettings::_AppendDynamicProfilesToUserSettings()
const auto diff = profile.GenerateStub();
auto profileSerialization = Json::writeString(wbuilder, diff);

// Add 8 spaces to the start of each line
profileSerialization.insert(0, DefaultProfilesIndentation);
// Add the user's indent to the start of each line
profileSerialization.insert(0, indentation);
// Get the first newline
size_t pos = profileSerialization.find("\n");
// for each newline...
while (pos != std::string::npos)
{
// Insert 8 spaces immediately following the current newline
profileSerialization.insert(pos + 1, DefaultProfilesIndentation);
profileSerialization.insert(pos + 1, indentation);
// Get the next newline
pos = profileSerialization.find("\n", pos + 9);
pos = profileSerialization.find("\n", pos + indentation.size() + 1);
}

// Write a comma, newline to the file
Expand Down
23 changes: 4 additions & 19 deletions src/cascadia/TerminalApp/TerminalPage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -481,9 +481,13 @@ namespace winrt::TerminalApp::implementation
g_hTerminalAppProvider, // handle to TerminalApp tracelogging provider
"TabInformation",
TraceLoggingDescription("Event emitted upon new tab creation in TerminalApp"),
TraceLoggingUInt32(1u, "EventVer", "Version of this event"),
TraceLoggingUInt32(tabCount, "TabCount", "Count of tabs currently opened in TerminalApp"),
TraceLoggingBool(usedManualProfile, "ProfileSpecified", "Whether the new tab specified a profile explicitly"),
TraceLoggingGuid(profileGuid, "ProfileGuid", "The GUID of the profile spawned in the new tab"),
TraceLoggingBool(settings.UseAcrylic(), "UseAcrylic", "The acrylic preference from the settings"),
TraceLoggingFloat64(settings.TintOpacity(), "TintOpacity", "Opacity preference from the settings"),
TraceLoggingWideString(settings.FontFace().c_str(), "FontFace", "Font face chosen in the settings"),
TraceLoggingKeyword(MICROSOFT_KEYWORD_MEASURES),
TelemetryPrivacyDataTag(PDT_ProductAndServicePerformance));
}
Expand Down Expand Up @@ -838,25 +842,6 @@ namespace winrt::TerminalApp::implementation
{
_lastTabClosedHandlers(*this, nullptr);
}

if (auto indexOpt{ _GetFocusedTabIndex() })
{
auto focusedTabIndex = *indexOpt;
if (tabIndex == focusedTabIndex)
{
uint32_t tabCount = _tabs.Size();
if (focusedTabIndex >= tabCount)
{
focusedTabIndex = tabCount - 1;
}
else if (focusedTabIndex < 0)
{
focusedTabIndex = 0;
}

_SelectTab(focusedTabIndex);
}
}
}

// Method Description:
Expand Down
2 changes: 1 addition & 1 deletion src/cascadia/TerminalApp/defaults.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"showTabsInTitlebar": true,
"showTerminalTitleInTitlebar": true,
"tabWidthMode": "equal",
"snapToGridOnResize": false,
"snapToGridOnResize": true,
"wordDelimiters": " /\\()\"'-.,:;<>~!@#$%^&*|+=[]{}~?\u2502",
"confirmCloseAllTabs": true,

Expand Down
2 changes: 1 addition & 1 deletion src/cascadia/TerminalApp/lib/TerminalAppLib.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@
<ItemDefinitionGroup>
<ClCompile>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
<AdditionalIncludeDirectories>..;$(OpenConsoleDir)\dep;$(OpenConsoleDir)\dep\jsoncpp\json;%(AdditionalIncludeDirectories);</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>..;$(OpenConsoleDir)\dep\jsoncpp\json;%(AdditionalIncludeDirectories);</AdditionalIncludeDirectories>
<!-- Manually disable unreachable code warning, because jconcpp has a ton of that. -->
<DisableSpecificWarnings>4702;%(DisableSpecificWarnings)</DisableSpecificWarnings>
</ClCompile>
Expand Down
35 changes: 21 additions & 14 deletions src/cascadia/TerminalApp/userDefaults.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,29 @@
"defaultProfile": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",

"profiles":
[
{
"defaults":
{
// Make changes here to the powershell.exe profile
"guid": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
"name": "Windows PowerShell",
"commandline": "powershell.exe",
"hidden": false
// Put settings here that you want to apply to all profiles
},
{
// Make changes here to the cmd.exe profile
"guid": "{0caa0dad-35be-5f56-a8ff-afceeeaa6101}",
"name": "cmd",
"commandline": "cmd.exe",
"hidden": false
}
],
"list":
[
{
// Make changes here to the powershell.exe profile
"guid": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
"name": "Windows PowerShell",
"commandline": "powershell.exe",
"hidden": false
},
{
// Make changes here to the cmd.exe profile
"guid": "{0caa0dad-35be-5f56-a8ff-afceeeaa6101}",
"name": "cmd",
"commandline": "cmd.exe",
"hidden": false
}
]
},

// Add custom color schemes to this array
"schemes": [],
Expand Down
13 changes: 13 additions & 0 deletions src/cascadia/TerminalConnection/ConptyConnection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,19 @@ namespace winrt::Microsoft::Terminal::TerminalConnection::implementation

DeleteProcThreadAttributeList(siEx.lpAttributeList);

const std::filesystem::path processName = wil::GetModuleFileNameExW<std::wstring>(_piClient.hProcess, nullptr);
_clientName = processName.filename().wstring();

#pragma warning(suppress : 26477 26485 26494 26482 26446) // We don't control TraceLoggingWrite
TraceLoggingWrite(
g_hTerminalConnectionProvider,
"ConPtyConnected",
TraceLoggingDescription("Event emitted when ConPTY connection is started"),
TraceLoggingGuid(_guid, "SessionGuid", "The WT_SESSION's GUID"),
TraceLoggingWideString(_clientName.c_str(), "Client", "The attached client process"),
TraceLoggingKeyword(MICROSOFT_KEYWORD_MEASURES),
TelemetryPrivacyDataTag(PDT_ProductAndServicePerformance));

return S_OK;
}
CATCH_RETURN();
Expand Down
1 change: 1 addition & 0 deletions src/cascadia/TerminalConnection/ConptyConnection.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ namespace winrt::Microsoft::Terminal::TerminalConnection::implementation
hstring _startingDirectory;
hstring _startingTitle;
guid _guid{}; // A unique session identifier for connected client
hstring _clientName{}; // The name of the process hosted by this ConPTY connection (as of launch).

bool _receivedFirstByte{ false };
std::chrono::high_resolution_clock::time_point _startTime{};
Expand Down
Loading

0 comments on commit cfeda22

Please sign in to comment.