Compare commits

..

7 Commits

Author SHA1 Message Date
Dustin L. Howett
90485935b3 Migrate spelling-0.0.21 changes from main 2020-05-26 09:56:11 -05:00
Dustin L. Howett
ad7824d9d0 Migrate spelling-0.0.19 changes from main 2020-05-26 09:56:11 -05:00
Mike Griese
5bbba56629 mostly just stashing this. The Perf is horrifyingly bad 2020-05-26 09:56:11 -05:00
Mike Griese
25e2e7ef70 This is basically just phase 1 of #1203. This draws the character on top of the cursor always 2020-05-22 16:11:39 -05:00
Mike Griese
9996e219a0 Remove all the old garbage ideas 2020-05-22 15:34:12 -05:00
Mike Griese
66803d0961 Write the entire spec 2020-05-22 15:27:16 -05:00
Mike Griese
fc99eebc3b Begin a horrible first draft of this spec 2020-05-22 15:02:01 -05:00
43 changed files with 226 additions and 1127 deletions

View File

@@ -231,7 +231,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "UnitTests_TerminalApp", "sr
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TerminalAppLib", "src\cascadia\TerminalApp\lib\TerminalAppLib.vcxproj", "{CA5CAD1A-9A12-429C-B551-8562EC954746}"
ProjectSection(ProjectDependencies) = postProject
{CA5CAD1A-0A1E-4F38-8704-9BFF1C37AA92} = {CA5CAD1A-0A1E-4F38-8704-9BFF1C37AA92}
{CA5CAD1A-44BD-4AC7-AC72-6CA5B3AB89ED} = {CA5CAD1A-44BD-4AC7-AC72-6CA5B3AB89ED}
{CA5CAD1A-D7EC-4107-B7C6-79CB77AE2907} = {CA5CAD1A-D7EC-4107-B7C6-79CB77AE2907}
EndProjectSection
@@ -303,8 +302,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TerminalAzBridge", "src\cas
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "fmt", "src\dep\fmt\fmt.vcxproj", "{6BAE5851-50D5-4934-8D5E-30361A8A40F3}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TerminalSettingsControl", "src\cascadia\TerminalSettingsControl\TerminalSettingsControl.vcxproj", "{CA5CAD1A-0A1E-4F38-8704-9BFF1C37AA92}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
AuditMode|Any CPU = AuditMode|Any CPU
@@ -1511,27 +1508,6 @@ Global
{6BAE5851-50D5-4934-8D5E-30361A8A40F3}.Release|x64.Build.0 = Release|x64
{6BAE5851-50D5-4934-8D5E-30361A8A40F3}.Release|x86.ActiveCfg = Release|Win32
{6BAE5851-50D5-4934-8D5E-30361A8A40F3}.Release|x86.Build.0 = Release|Win32
{CA5CAD1A-0A1E-4F38-8704-9BFF1C37AA92}.AuditMode|Any CPU.ActiveCfg = AuditMode|Win32
{CA5CAD1A-0A1E-4F38-8704-9BFF1C37AA92}.AuditMode|ARM64.ActiveCfg = AuditMode|ARM64
{CA5CAD1A-0A1E-4F38-8704-9BFF1C37AA92}.AuditMode|ARM64.Build.0 = AuditMode|ARM64
{CA5CAD1A-0A1E-4F38-8704-9BFF1C37AA92}.AuditMode|x64.ActiveCfg = AuditMode|x64
{CA5CAD1A-0A1E-4F38-8704-9BFF1C37AA92}.AuditMode|x64.Build.0 = AuditMode|x64
{CA5CAD1A-0A1E-4F38-8704-9BFF1C37AA92}.AuditMode|x86.ActiveCfg = AuditMode|Win32
{CA5CAD1A-0A1E-4F38-8704-9BFF1C37AA92}.AuditMode|x86.Build.0 = AuditMode|Win32
{CA5CAD1A-0A1E-4F38-8704-9BFF1C37AA92}.Debug|Any CPU.ActiveCfg = Debug|Win32
{CA5CAD1A-0A1E-4F38-8704-9BFF1C37AA92}.Debug|ARM64.ActiveCfg = Debug|ARM64
{CA5CAD1A-0A1E-4F38-8704-9BFF1C37AA92}.Debug|ARM64.Build.0 = Debug|ARM64
{CA5CAD1A-0A1E-4F38-8704-9BFF1C37AA92}.Debug|x64.ActiveCfg = Debug|x64
{CA5CAD1A-0A1E-4F38-8704-9BFF1C37AA92}.Debug|x64.Build.0 = Debug|x64
{CA5CAD1A-0A1E-4F38-8704-9BFF1C37AA92}.Debug|x86.ActiveCfg = Debug|Win32
{CA5CAD1A-0A1E-4F38-8704-9BFF1C37AA92}.Debug|x86.Build.0 = Debug|Win32
{CA5CAD1A-0A1E-4F38-8704-9BFF1C37AA92}.Release|Any CPU.ActiveCfg = Release|Win32
{CA5CAD1A-0A1E-4F38-8704-9BFF1C37AA92}.Release|ARM64.ActiveCfg = Release|ARM64
{CA5CAD1A-0A1E-4F38-8704-9BFF1C37AA92}.Release|ARM64.Build.0 = Release|ARM64
{CA5CAD1A-0A1E-4F38-8704-9BFF1C37AA92}.Release|x64.ActiveCfg = Release|x64
{CA5CAD1A-0A1E-4F38-8704-9BFF1C37AA92}.Release|x64.Build.0 = Release|x64
{CA5CAD1A-0A1E-4F38-8704-9BFF1C37AA92}.Release|x86.ActiveCfg = Release|Win32
{CA5CAD1A-0A1E-4F38-8704-9BFF1C37AA92}.Release|x86.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@@ -1610,7 +1586,6 @@ Global
{024052DE-83FB-4653-AEA4-90790D29D5BD} = {E8F24881-5E37-4362-B191-A3BA0ED7F4EB}
{067F0A06-FCB7-472C-96E9-B03B54E8E18D} = {59840756-302F-44DF-AA47-441A9D673202}
{6BAE5851-50D5-4934-8D5E-30361A8A40F3} = {81C352DB-1818-45B7-A284-18E259F1CC87}
{CA5CAD1A-0A1E-4F38-8704-9BFF1C37AA92} = {59840756-302F-44DF-AA47-441A9D673202}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {3140B1B7-C8EE-43D1-A772-D82A7061A271}

View File

@@ -36,14 +36,6 @@ 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!
#### Via Windows Package Manager CLI (aka winget)
[winget](https://github.com/microsoft/winget-cli) users can download and install the latest Terminal release by installing the `Microsoft.WindowsTerminal` package:
```powershell
winget install --id=Microsoft.WindowsTerminal -e
```
#### Via Chocolatey (unofficial)
[Chocolatey](https://chocolatey.org) users can download and install the latest Terminal release by installing the `microsoft-windows-terminal` package:

View File

@@ -0,0 +1,152 @@
---
author: Mike Griese @zadjii-msft
created on: 2020-05-22
last updated: 2020-05-22
issue id: 1203
---
# Cursor Text Foreground Color
## Abstract
In the original conhost, the text cursor was originally drawn by inverting the
color of the cell it was over, including the color of the text under the cursor.
This made it easy for the text to stand out against the cursor, because the text
would be inverted just like the text background color.
However, with the Windows Terminal and the new DX renderer we use, it's much
_much_ harder to invert the colors of an arbitrary region of the window.
The user can currently configure the color of the cursor in the Terminal, but
the cursor is always drawn _on top_ of the cell it's on. This is because the
Terminal shares the same rendering stack as the vintage console did, where the
console needed to invert the cell as the _last_ step in the renderer. This means
that the cell under the text cursor is always totally obscured when the cursor
is in "filledBox" mode.
This spec outlines the addition of a new setting `cursorTextColor`, that would
allow the text under the cursor to be drawn in another color, so that the text
will always be visible.
## Solution Design
We're going to draw the cursor in two phases - a pre-paint and a post-paint. All
the other renderers will just return `S_FALSE` from the cursor pre-paint phase
automatically - we absolutely don't need to implement it for them.
We'll introduce `cursorTextColor` as a setting that accepts the following
values:
* `"#rrggbb"` (a color): paint the character the cursor is on in the given color
* `"textForeground"`: paint the character the cursor is on _on top of the
cursor_ in the text foreground color.
* `"textBackground"`: paint the character the cursor is on _on top of the
cursor_ in the text _background_ color. (This is like what gVim does, see
[this
comment](https://github.com/microsoft/terminal/issues/1203#issuecomment-618754090)).
* `null`: Paint the cursor _on top of the character_ always.
`null` is effectively the behavior we have now. I'm proposing we move the
default _for all profiles_ to `textForeground`.
Currently, the cursor is drawn once in the renderer, after the text is sent to
the render engine to be drawn. I propose we add an optional cursor pre-paint
step to the renderer & engine, to give the renderer a chance to draw the cursor
_before_ the text is drawn to the screen.
We're going to draw the cursor in two phases - a pre-paint and a post-paint. All
the other renderers will just return `S_FALSE` from the cursor pre-paint phase
automatically - we absolutely don't need to implement it for them.
For the DX renderer (the Terminal render engine), we'll modify our behavior.
* `null`: This is the current behavior. Cursor is drawn in post-paint, on top of
the cell.
* `"textForeground"`: Cursor is drawn in pre-paint, underneath the text from the
cell.
* `"#rrggbb"`: Cursor is drawn in pre-paint, underneath the text from the cell.
The renderer will return `S_FALSE` from the cursor pre-paint phase, indicating
we should manually break the text run where the cursor is. When we draw the
run where the cursor is, we'll draw it using the the provided color
(`#rrggbb`) instead.
* `"textBackground"`: This is the same as the `#rrggbb` case, but with the cell
the cursor is on being drawn in the current background color for that cell.
In a table form, these cases look like the following. Assume that `cursorColor` is set to `#rrggbb`:
cursorShape | cursorTextColor | Break Ligatures? | Pre-draw cursor | character color | post-draw cursor | Result | Notes
-- | -- | -- | -- | -- | -- | -- | --
Filled Box | | | | | | |
Filled Box | `null` | FALSE | N/A | cell FG | #rrggbb | Solid box of #rrggbb | Current behavior
Filled Box | `#r2g2b2` | TRUE | #rrggbb | #r2g2b2 | N/A | Box of #rrggbb with character in #r2g2b2 on top |
Filled Box | `textForeground` | FALSE | #rrggbb | cell FG | N/A | Box of #rrggbb with character in (text FG) on top | Proposed Default
Filled Box | `textBackground` | TRUE | #rrggbb | cell BG | N/A | Box of #rrggbb with character in (text BG) on top |
Vintage | | | | | | | |
Vintage | `null` | FALSE | N/A | cell FG | #rrggbb | ▃ of #rrggbb on top of char in (text FG) | Current behavior
Vintage | `#r2g2b2` | TRUE | #rrggbb | #r2g2b2 | N/A | ▃ of #rrggbb with character in #r2g2b2 on top of ▃ |
Vintage | `textForeground` | FALSE | #rrggbb | cell FG | N/A | ▃ of #rrggbb with character in (text FG) on top of ▃ | Proposed Default
Vintage | `textBackground` | TRUE | #rrggbb | cell BG | N/A | ▃ of #rrggbb with character in (text BG) on top of ▃ |
Vertical Bar | | | | | | | |
Vertical Bar | `null` | FALSE | N/A | cell FG | #rrggbb | ┃ of #rrggbb on top of char in (text FG) | Current behavior
Vertical Bar | `#r2g2b2` | TRUE | #rrggbb | #r2g2b2 | N/A | ┃ of #rrggbb with character in #r2g2b2 on top of ┃ |
Vertical Bar | `textForeground` | FALSE | #rrggbb | cell FG | N/A | ┃ of #rrggbb with character in (text FG) on top of ┃ | Proposed Default
Vertical Bar | `textBackground` | TRUE | #rrggbb | cell BG | N/A | ┃ of #rrggbb with character in (text BG) on top of ┃ |
I omitted `underscore`, `emptyBox` because they're just the same as Vertical Bar
cases.
### Implementation plan
I believe this work can be broken into 3 PRs:
1. The first would simply move the Terminal to use `"cursorTextColor":
"textForeground"` by default. This won't introduce the setting or anything -
merely change the default behavior silently so the character appears on top
of the cursor.
2. The second would actually introduce the `cursorTextColor` setting, accepting
only `null` or `textForeground`. This will let users opt-in to the old
behavior.
3. the third would introduce the `#rrggbb` and `textBackground` settings to the
`cursorTextColor` property. This is left as a separate PR because these
involve manually breaking runs of characters on the cell where the cursor is,
which will require some extra plumbing.
I'd want to get both 1&2 done in the course of a single release. Ideally all 3
would be done in the course of a single release, but if only the first two are
done, then at least users can opt-out of the new behavior.
## Capabilities
### Accessibility
This should make it _easier_ for users to actually tell what the character under the cursor is.
### Security
N/A
### Reliability
N/A
### Compatibility
Renderers other than the DX renderer will all auto-return `S_FALSE` from the
cursor pre-paint phase, leaving their behavior unchanged.
### Performance, Power, and Efficiency
N/A
## Potential Issues
## Future considerations
* This whole scenario feels a lot like how `selectionForeground` ([#3580]) should work.
## Resources
Feature Request: Show character under cursor when cursorShape is set to filledBox [#1203]
<!-- Footnotes -->
[#1203]: https://github.com/microsoft/terminal/issues/1203
[#3580]: https://github.com/microsoft/terminal/issues/3580

View File

@@ -68,7 +68,6 @@
somehow. So make sure to only include top-level dependencies here (don't
include Settings and Connection, since Control will include them for us) -->
<ProjectReference Include="$(OpenConsoleDir)src\cascadia\TerminalSettings\TerminalSettings.vcxproj" />
<ProjectReference Include="$(OpenConsoleDir)src\cascadia\TerminalSettingsControl\TerminalSettingsControl.vcxproj" />
<ProjectReference Include="$(OpenConsoleDir)src\cascadia\TerminalConnection\TerminalConnection.vcxproj" />
<ProjectReference Include="$(OpenConsoleDir)src\cascadia\TerminalControl\TerminalControl.vcxproj" />
<!-- Reference TerminalAppLib here, so we can use it's TerminalApp.winmd as

View File

@@ -11,7 +11,6 @@
#include <LibraryResources.h>
#include "TerminalPage.g.cpp"
#include <winrt/Windows.Storage.h>
#include <winrt/Microsoft.UI.Xaml.XamlTypeInfo.h>
#include "AzureCloudShellGenerator.h" // For AzureConnectionType
@@ -20,8 +19,6 @@
#include "ColorHelper.h"
#include "DebugTapConnection.h"
#include <winrt/Microsoft.Terminal.Settings.Control.h>
using namespace winrt;
using namespace winrt::Windows::Foundation::Collections;
using namespace winrt::Windows::UI::Xaml;
@@ -1471,16 +1468,6 @@ namespace winrt::TerminalApp::implementation
{
text = co_await data.GetTextAsync();
}
// Windows Explorer's "Copy address" menu item stores a StorageItem in the clipboard, and no text.
else if (data.Contains(StandardDataFormats::StorageItems()))
{
Windows::Foundation::Collections::IVectorView<Windows::Storage::IStorageItem> items = co_await data.GetStorageItemsAsync();
if (items.Size() > 0)
{
Windows::Storage::IStorageItem item = items.GetAt(0);
text = item.Path();
}
}
eventArgs.HandleClipboardData(text);
}
CATCH_LOG();
@@ -1512,29 +1499,20 @@ namespace winrt::TerminalApp::implementation
// a background thread, as to not hang/crash the UI thread.
fire_and_forget TerminalPage::_LaunchSettings(const bool openDefaults)
{
openDefaults;
// This will switch the execution of the function to a background (not
// UI) thread. This is IMPORTANT, because the Windows.Storage API's
// (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();
auto settingsPage = winrt::make_self<::winrt::Microsoft::Terminal::Settings::Control::MainPage>();
auto tabViewItem = ::winrt::MUX::Controls::TabViewItem{};
_tabView.TabItems().Append(tabViewItem);
_tabView.SelectedItem(settingsPage);
const auto settingsPath = openDefaults ? CascadiaSettings::GetDefaultSettingsPath() :
CascadiaSettings::GetSettingsPath();
//// This will switch the execution of the function to a background (not
//// UI) thread. This is IMPORTANT, because the Windows.Storage API's
//// (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();
//const auto settingsPath = openDefaults ? CascadiaSettings::GetDefaultSettingsPath() :
// CascadiaSettings::GetSettingsPath();
//HINSTANCE res = ShellExecute(nullptr, nullptr, settingsPath.c_str(), nullptr, nullptr, SW_SHOW);
//if (static_cast<int>(reinterpret_cast<uintptr_t>(res)) <= 32)
//{
// ShellExecute(nullptr, nullptr, L"notepad", settingsPath.c_str(), nullptr, SW_SHOW);
//}
HINSTANCE res = ShellExecute(nullptr, nullptr, settingsPath.c_str(), nullptr, nullptr, SW_SHOW);
if (static_cast<int>(reinterpret_cast<uintptr_t>(res)) <= 32)
{
ShellExecute(nullptr, nullptr, L"notepad", settingsPath.c_str(), nullptr, SW_SHOW);
}
}
// Method Description:

View File

@@ -274,12 +274,6 @@
<Private>false</Private>
<CopyLocalSatelliteAssemblies>false</CopyLocalSatelliteAssemblies>
</Reference>
<Reference Include="Microsoft.Terminal.Settings.Control">
<HintPath>$(_BinRoot)TerminalSettingsControl\Microsoft.Terminal.Settings.Control.winmd</HintPath>
<IsWinMDFile>true</IsWinMDFile>
<Private>false</Private>
<CopyLocalSatelliteAssemblies>false</CopyLocalSatelliteAssemblies>
</Reference>
<Reference Include="Microsoft.Terminal.TerminalConnection">
<HintPath>$(_BinRoot)TerminalConnection\Microsoft.Terminal.TerminalConnection.winmd</HintPath>
<IsWinMDFile>true</IsWinMDFile>

View File

@@ -18,7 +18,7 @@
Microsoft namespace. This is, obviously, not great. None of our other
projects compile properly when they depend on this "Microsoft.winmd."
-->
<CppWinRTNamespaceMergeDepth>4</CppWinRTNamespaceMergeDepth>
<CppWinRTNamespaceMergeDepth>3</CppWinRTNamespaceMergeDepth>
<!--
DON'T REDIRECT OUR OUTPUT.

View File

@@ -1,30 +0,0 @@
#include "pch.h"
#include "ColorSchemes.h"
#if __has_include("ColorSchemes.g.cpp")
#include "ColorSchemes.g.cpp"
#endif
using namespace winrt::Windows::UI::Xaml;
namespace winrt::Microsoft::Terminal::Settings::Control::implementation
{
ColorSchemes::ColorSchemes()
{
InitializeComponent();
}
int32_t ColorSchemes::MyProperty()
{
throw hresult_not_implemented();
}
void ColorSchemes::MyProperty(int32_t /* value */)
{
throw hresult_not_implemented();
}
void ColorSchemes::ClickHandler(IInspectable const&, RoutedEventArgs const&)
{
//Button().Content(box_value(L"Clicked"));
}
}

View File

@@ -1,23 +0,0 @@
#pragma once
#include "ColorSchemes.g.h"
namespace winrt::Microsoft::Terminal::Settings::Control::implementation
{
struct ColorSchemes : ColorSchemesT<ColorSchemes>
{
ColorSchemes();
int32_t MyProperty();
void MyProperty(int32_t value);
void ClickHandler(Windows::Foundation::IInspectable const& sender, Windows::UI::Xaml::RoutedEventArgs const& args);
};
}
namespace winrt::Microsoft::Terminal::Settings::Control::factory_implementation
{
struct ColorSchemes : ColorSchemesT<ColorSchemes, implementation::ColorSchemes>
{
};
}

View File

@@ -1,9 +0,0 @@
namespace Microsoft.Terminal.Settings.Control
{
[default_interface]
runtimeclass ColorSchemes : Windows.UI.Xaml.Controls.Page
{
ColorSchemes();
Int32 MyProperty;
}
}

View File

@@ -1,48 +0,0 @@
<Page
x:Class="Microsoft.Terminal.Settings.Control.ColorSchemes"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:Microsoft.Terminal.Settings"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d">
<RelativePanel Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<TextBlock x:Name="TitleTextBox"
Text="Color Schemes"
Style="{StaticResource HeaderTextBlockStyle}"
Margin="0,0,0,8" />
<GridView x:Name="ProfilesGridView"
Margin="0,0,0,8"
RelativePanel.AlignLeftWithPanel="True"
RelativePanel.AlignRightWithPanel="True"
RelativePanel.Below="TitleTextBox">
<GridView.ItemsPanel>
<ItemsPanelTemplate>
<ItemsWrapGrid x:Name="MaxItemsWrapGrid"
MaximumRowsOrColumns="2"
Orientation="Horizontal"/>
</ItemsPanelTemplate>
</GridView.ItemsPanel>
<Image Source="Assets/AllTerminalColorSchemes (2).png"
Stretch="Uniform"
Width="300"/>
<Image Source="Assets/AllTerminalColorSchemes (3).png"
Stretch="Uniform"
Width="300"/>
<Image Source="Assets/AllTerminalColorSchemes (4).png"
Stretch="Uniform"
Width="300"/>
<Image Source="Assets/AllTerminalColorSchemes (5).png"
Stretch="Uniform"
Width="300"/>
<Image Source="Assets/AllTerminalColorSchemes (6).png"
Stretch="Uniform"
Width="300"/>
<Image Source="Assets/AllTerminalColorSchemes (7).png"
Stretch="Uniform"
Width="300"/>
</GridView>
</RelativePanel>
</Page>

View File

@@ -1,29 +0,0 @@
#include "pch.h"
#include "Globals.h"
#include "Globals.g.cpp"
using namespace winrt;
using namespace winrt::Windows::UI::Xaml;
namespace winrt::Microsoft::Terminal::Settings::Control::implementation
{
Globals::Globals()
{
InitializeComponent();
}
int32_t Globals::MyProperty()
{
throw hresult_not_implemented();
}
void Globals::MyProperty(int32_t /* value */)
{
throw hresult_not_implemented();
}
void Globals::ClickHandler(IInspectable const&, RoutedEventArgs const&)
{
}
}

View File

@@ -1,23 +0,0 @@
#pragma once
#include "Globals.g.h"
namespace winrt::Microsoft::Terminal::Settings::Control::implementation
{
struct Globals : GlobalsT<Globals>
{
Globals();
int32_t MyProperty();
void MyProperty(int32_t value);
void ClickHandler(Windows::Foundation::IInspectable const& sender, Windows::UI::Xaml::RoutedEventArgs const& args);
};
}
namespace winrt::Microsoft::Terminal::Settings::Control::factory_implementation
{
struct Globals : GlobalsT<Globals, implementation::Globals>
{
};
}

View File

@@ -1,9 +0,0 @@
namespace Microsoft.Terminal.Settings.Control
{
[default_interface]
runtimeclass Globals : Windows.UI.Xaml.Controls.Page
{
Globals();
Int32 MyProperty;
}
}

View File

@@ -1,80 +0,0 @@
<Page
x:Class="Microsoft.Terminal.Settings.Control.Globals"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:Microsoft.Terminal.Settings.Control"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:Controls="using:Microsoft.UI.Xaml.Controls"
mc:Ignorable="d">
<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"
Margin="0,12,0,0">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*" />
<ColumnDefinition Width="1*" />
</Grid.ColumnDefinitions>
<TextBlock Text="Globals"
Style="{StaticResource HeaderTextBlockStyle}"
Margin="0,0,0,10" />
<StackPanel Grid.Row="1" Grid.Column="0" Margin="0,0,100,0">
<TextBlock Text="Appearance"
Style="{StaticResource TitleTextBlockStyle}" Margin="0,0,0,10" />
<Controls:RadioButtons Header="Requested Theme" Margin="0,0,0,10">
<RadioButton x:Name="SystemTheme" Content="System"/>
<RadioButton x:Name="DarkTheme" Content="Dark"/>
<RadioButton x:Name="LightTheme" Content="Light"/>
</Controls:RadioButtons>
<Controls:RadioButtons Header="Launch mode" Margin="0,0,0,10">
<RadioButton x:Name="DefaultLaunchMode" Content="Default"/>
<RadioButton x:Name="MaximizedLaunchMode" Content="Maximized"/>
</Controls:RadioButtons>
<RelativePanel Margin="0,0,0,10">
<Controls:NumberBox x:Name="InitialCols"
Header="Initial Columns"
Value="120"
SpinButtonPlacementMode="Compact"
SmallChange="10"
LargeChange="100"
Margin="0,0,20,0"/>
<Controls:NumberBox x:Name="InitialRows"
Header="Initial Rows"
Value="30"
SpinButtonPlacementMode="Compact"
SmallChange="10"
LargeChange="100"
Margin="0,0,20,0"
RelativePanel.RightOf="InitialCols"/>
<TextBox Header="Initial position"
RelativePanel.RightOf="InitialRows"/>
</RelativePanel>
<CheckBox Content="Always show tabs" />
<CheckBox Content="Show Terminal title in titlebar" />
<CheckBox Content="Show tabs in titlebar" Margin="0,0,0,10" />
<Controls:RadioButtons Header="Tab width mode">
<RadioButton x:Name="EqualTabWidthMode" Content="Equal"/>
<RadioButton x:Name="TitleLengthTabWidthMode" Content="Title length"/>
</Controls:RadioButtons>
</StackPanel>
<StackPanel Grid.Row="1" Grid.Column="1" Margin="0,0,100,0">
<TextBlock Text="Interaction"
Style="{StaticResource TitleTextBlockStyle}" Margin="0,0,0,10" />
<TextBox Header="Default profile" Margin="0,0,0,10" />
<TextBox Header="Word delimeters" Margin="0,0,0,10" />
<CheckBox Content="Confirm close all tabs" />
<CheckBox Content="Copy on select" />
<CheckBox Content="Snap to grid on resize" Margin="0,0,0,10" />
<Controls:NumberBox x:Name="RowsToScroll"
Header="Rows to scroll"
Value="30"
SpinButtonPlacementMode="Compact"
SmallChange="10"
LargeChange="100"
Width="100" HorizontalAlignment="Left"/>
</StackPanel>
</Grid>
</Page>

View File

@@ -1,30 +0,0 @@
#include "pch.h"
#include "Keybindings.h"
#if __has_include("Keybindings.g.cpp")
#include "Keybindings.g.cpp"
#endif
using namespace winrt::Windows::UI::Xaml;
namespace winrt::Microsoft::Terminal::Settings::Control::implementation
{
Keybindings::Keybindings()
{
InitializeComponent();
}
int32_t Keybindings::MyProperty()
{
throw hresult_not_implemented();
}
void Keybindings::MyProperty(int32_t /* value */)
{
throw hresult_not_implemented();
}
void Keybindings::ClickHandler(IInspectable const&, RoutedEventArgs const&)
{
//Button().Content(box_value(L"Clicked"));
}
}

View File

@@ -1,23 +0,0 @@
#pragma once
#include "Keybindings.g.h"
namespace winrt::Microsoft::Terminal::Settings::Control::implementation
{
struct Keybindings : KeybindingsT<Keybindings>
{
Keybindings();
int32_t MyProperty();
void MyProperty(int32_t value);
void ClickHandler(Windows::Foundation::IInspectable const& sender, Windows::UI::Xaml::RoutedEventArgs const& args);
};
}
namespace winrt::Microsoft::Terminal::Settings::Control::factory_implementation
{
struct Keybindings : KeybindingsT<Keybindings, implementation::Keybindings>
{
};
}

View File

@@ -1,9 +0,0 @@
namespace Microsoft.Terminal.Settings.Control
{
[default_interface]
runtimeclass Keybindings : Windows.UI.Xaml.Controls.Page
{
Keybindings();
Int32 MyProperty;
}
}

View File

@@ -1,19 +0,0 @@
<Page
x:Class="Microsoft.Terminal.Settings.Control.Keybindings"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:Microsoft.Terminal.Settings.Control"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d">
<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"
Margin="0,12,0,0">
<StackPanel>
<TextBlock x:Name="TitleTextBox"
Text="Keybindings"
Style="{StaticResource HeaderTextBlockStyle}"
Margin="0,0,0,8" />
</StackPanel>
</Grid>
</Page>

View File

@@ -1,93 +0,0 @@
#include "pch.h"
#include "MainPage.h"
#include "MainPage.g.cpp"
#include "Globals.h"
#include "Profiles.h"
#include "ColorSchemes.h"
#include "Keybindings.h"
using namespace winrt::Windows::UI::Xaml;
namespace winrt::Microsoft::Terminal::Settings::Control::implementation
{
MainPage::MainPage()
{
InitializeComponent();
}
int32_t MainPage::MyProperty()
{
throw hresult_not_implemented();
}
void MainPage::MyProperty(int32_t /* value */)
{
throw hresult_not_implemented();
}
void MainPage::ClickHandler(IInspectable const&, RoutedEventArgs const&)
{
}
void MainPage::SettingsNav_Loaded(IInspectable const&, RoutedEventArgs const&)
{
//// set the initial selectedItem
for (uint32_t i = 0; i < SettingsNav().MenuItems().Size(); i++)
{
const auto item = SettingsNav().MenuItems().GetAt(i).as<Controls::NavigationViewItemBase>();
const hstring globalsNav = L"Globals_Nav";
const hstring itemTag = unbox_value<hstring>(item.Tag());
if (itemTag == globalsNav)
{
item.IsSelected(true);
SettingsNav().Header() = item.Tag();
break;
}
}
contentFrame().Navigate(xaml_typename<Control::Globals>());
}
void MainPage::SettingsNav_SelectionChanged(Controls::NavigationView sender, Controls::NavigationViewSelectionChangedEventArgs args)
{
}
void MainPage::SettingsNav_ItemInvoked(Controls::NavigationView sender, Controls::NavigationViewItemInvokedEventArgs args)
{
Controls::TextBlock item = args.InvokedItem().as<Controls::TextBlock>();
if (item != NULL)
{
const hstring globalsPage = L"Globals_Page";
const hstring profilesPage = L"Profiles_Page";
const hstring colorSchemesPage = L"ColorSchemes_Page";
const hstring keybindingsPage = L"Keybindings_Page";
if (unbox_value<hstring>(item.Tag()) == globalsPage)
{
contentFrame().Navigate(xaml_typename<Control::Globals>());
}
else if (unbox_value<hstring>(item.Tag()) == profilesPage)
{
contentFrame().Navigate(xaml_typename<Control::Profiles>());
}
else if (unbox_value<hstring>(item.Tag()) == colorSchemesPage)
{
contentFrame().Navigate(xaml_typename<Control::ColorSchemes>());
}
else if (unbox_value<hstring>(item.Tag()) == keybindingsPage)
{
contentFrame().Navigate(xaml_typename<Control::Keybindings>());
}
}
}
}
//void winrt::Microsoft::Terminal::Settings::Control::implementation::MainPage::SettingsNav_SelectionChanged(winrt::Windows::UI::Xaml::Controls::NavigationView const& sender, winrt::Windows::UI::Xaml::Controls::NavigationViewSelectionChangedEventArgs const& args)
//{
//
//}

View File

@@ -1,27 +0,0 @@
#pragma once
#include "MainPage.g.h"
#include "winrt/Microsoft.UI.Xaml.Controls.h"
namespace winrt::Microsoft::Terminal::Settings::Control::implementation
{
struct MainPage : MainPageT<MainPage>
{
MainPage();
int32_t MyProperty();
void MyProperty(int32_t value);
void ClickHandler(Windows::Foundation::IInspectable const& sender, Windows::UI::Xaml::RoutedEventArgs const& args);
void SettingsNav_Loaded(Windows::Foundation::IInspectable const& sender, Windows::UI::Xaml::RoutedEventArgs const& args);
void SettingsNav_SelectionChanged(Windows::UI::Xaml::Controls::NavigationView sender, Windows::UI::Xaml::Controls::NavigationViewSelectionChangedEventArgs args);
void SettingsNav_ItemInvoked(Windows::UI::Xaml::Controls::NavigationView sender, Windows::UI::Xaml::Controls::NavigationViewItemInvokedEventArgs args);
};
}
namespace winrt::Microsoft::Terminal::Settings::Control::factory_implementation
{
struct MainPage : MainPageT<MainPage, implementation::MainPage>
{
};
}

View File

@@ -1,9 +0,0 @@
namespace Microsoft.Terminal.Settings.Control
{
[default_interface]
runtimeclass MainPage : Windows.UI.Xaml.Controls.Page
{
MainPage();
Int32 MyProperty;
}
}

View File

@@ -1,52 +0,0 @@
<Page
x:Class="Microsoft.Terminal.Settings.Control.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:Microsoft.Terminal.Settings.Control"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:muxc="using:Microsoft.UI.Xaml.Controls"
mc:Ignorable="d">
<NavigationView x:Name="SettingsNav"
IsSettingsVisible="False"
Loaded="SettingsNav_Loaded"
SelectionChanged="SettingsNav_SelectionChanged"
ItemInvoked="SettingsNav_ItemInvoked">
<NavigationView.AutoSuggestBox>
<AutoSuggestBox PlaceholderText="Search" QueryIcon="Find"/>
</NavigationView.AutoSuggestBox>
<NavigationView.MenuItems>
<NavigationViewItem Icon="Globe"
Tag="Globals_Nav" >
<TextBlock Tag="Globals_Page">Globals</TextBlock>
</NavigationViewItem>
<NavigationViewItem Tag="Profiles_Nav">
<NavigationViewItem.Icon>
<FontIcon Glyph="&#xE756;" />
</NavigationViewItem.Icon>
<TextBlock Tag="Profiles_Page">Profiles</TextBlock>
</NavigationViewItem>
<NavigationViewItem Tag="ColorSchemes_Nav">
<NavigationViewItem.Icon>
<FontIcon Glyph="&#xE790;"></FontIcon>
</NavigationViewItem.Icon>
<TextBlock Tag="ColorSchemes_Page">Color Schemes</TextBlock>
</NavigationViewItem>
<NavigationViewItem Icon="Keyboard"
Tag="Keybindings_Nav">
<TextBlock Tag="Keybindings_Page">Keybindings</TextBlock>
</NavigationViewItem>
</NavigationView.MenuItems>
<NavigationView.PaneFooter>
<NavigationViewItem>
<NavigationViewItem.Icon>
<FontIcon Glyph="&#xE713;" />
</NavigationViewItem.Icon>
<TextBlock>Open JSON file</TextBlock>
</NavigationViewItem>
</NavigationView.PaneFooter>
<Frame x:Name="contentFrame"
Margin="20"></Frame>
</NavigationView>
</Page>

View File

@@ -1,46 +0,0 @@
#include "pch.h"
#include "Profiles.h"
#include "Profiles.g.cpp"
using namespace winrt::Windows::UI::Xaml;
namespace winrt::Microsoft::Terminal::Settings::Control::implementation
{
Profiles::Profiles()
{
InitializeComponent();
}
Profiles::Profiles(winrt::hstring const& name) : m_name{ name }
{
}
winrt::hstring Profiles::Name()
{
return m_name;
}
void Profiles::Name(winrt::hstring const& value)
{
if (m_name != value)
{
}
}
int32_t Profiles::MyProperty()
{
throw hresult_not_implemented();
}
void Profiles::MyProperty(int32_t /* value */)
{
throw hresult_not_implemented();
}
void Profiles::ClickHandler(IInspectable const&, RoutedEventArgs const&)
{
}
}

View File

@@ -1,29 +0,0 @@
#pragma once
#include "Profiles.g.h"
namespace winrt::Microsoft::Terminal::Settings::Control::implementation
{
struct Profiles : ProfilesT<Profiles>
{
Profiles();
Profiles(winrt::hstring const& name);
int32_t MyProperty();
void MyProperty(int32_t value);
winrt::hstring Name();
void Name(winrt::hstring const& value);
void ClickHandler(Windows::Foundation::IInspectable const& sender, Windows::UI::Xaml::RoutedEventArgs const& args);
private:
winrt::hstring m_name;
};
}
namespace winrt::Microsoft::Terminal::Settings::Control::factory_implementation
{
struct Profiles : ProfilesT<Profiles, implementation::Profiles>
{
};
}

View File

@@ -1,9 +0,0 @@
namespace Microsoft.Terminal.Settings.Control
{
[default_interface]
runtimeclass Profiles : Windows.UI.Xaml.Controls.Page
{
Profiles();
Int32 MyProperty;
}
}

View File

@@ -1,114 +0,0 @@
<Page
x:Class="Microsoft.Terminal.Settings.Control.Profiles"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:Microsoft.Terminal.Settings.Control"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:Windows10version1809="http://schemas.microsoft.com/winfx/2006/xaml/presentation?IsApiContractPresent(Windows.Foundation.UniversalApiContract, 7)"
mc:Ignorable="d">
<RelativePanel Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<TextBlock x:Name="TitleTextBox"
Text="Profiles"
Style="{StaticResource HeaderTextBlockStyle}"
Margin="0,0,0,8" />
<GridView x:Name="ProfilesGridView"
Margin="0,0,0,8"
RelativePanel.AlignLeftWithPanel="True"
RelativePanel.AlignRightWithPanel="True"
RelativePanel.Below="TitleTextBox">
<GridView.ItemsPanel>
<ItemsPanelTemplate>
<ItemsWrapGrid x:Name="MaxItemsWrapGrid"
MaximumRowsOrColumns="2"
Orientation="Horizontal"/>
</ItemsPanelTemplate>
</GridView.ItemsPanel>
<Image Source="Assets/AllTerminalProfiles (2).png"
Stretch="Uniform"
Width="300"/>
<Image Source="Assets/AllTerminalProfiles (3).png"
Stretch="Uniform"
Width="300"/>
<Image Source="Assets/AllTerminalProfiles (4).png"
Stretch="Uniform"
Width="300"/>
<Image Source="Assets/AllTerminalProfiles (5).png"
Stretch="Uniform"
Width="300"/>
<Image Source="Assets/AllTerminalProfiles (6).png"
Stretch="Uniform"
Width="300"/>
<Image Source="Assets/AllTerminalProfiles (7).png"
Stretch="Uniform"
Width="300"/>
</GridView>
</RelativePanel>
<!--
<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"
Margin="0,12,0,0">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*" />
</Grid.ColumnDefinitions>
<TextBlock Text="Profiles"
Style="{StaticResource HeaderTextBlockStyle}"
Margin="0,0,0,10" />
<GridView x:Name="StyledGrid"
Grid.Row="1"
Margin="0,0,100,0" >
<GridView.ItemTemplate>
<DataTemplate x:DataType="x:String">
</DataTemplate>
</GridView.ItemTemplate>
<GridView.ItemContainerStyle>
<Style TargetType="GridViewItem">
<Setter Property="Margin" Value="5, 5, 5, 5"/>
</Style>
</GridView.ItemContainerStyle>
An extra property also needs to be added to the GridView's ItemsWrapGrid.
The following sets the maximum # of items to show before wrapping.
<GridView.ItemsPanel>
<ItemsPanelTemplate>
<ItemsWrapGrid x:Name="MaxItemsWrapGrid"
MaximumRowsOrColumns="2"
Orientation="Horizontal"/>
</ItemsPanelTemplate>
</GridView.ItemsPanel>
<x:String>Defaults</x:String>
<x:String>Command Prompt</x:String>
<x:String>Windows PowerShell</x:String>
<x:String>Ubuntu</x:String>
<x:String>PowerShell Core</x:String>
<x:String>Add New</x:String>
</GridView>
</Grid> -->
<!--<DataTemplate x:Name="ImageOverlayTemplate">
<Grid Width="100">
<Image Stretch="UniformToFill"/>
<StackPanel Orientation="Vertical" Height="40" VerticalAlignment="Bottom" Padding="5,1,5,1"
Background="LightGray" Opacity=".75">
<TextBlock Text="Defaults"/>
<StackPanel Orientation="Horizontal">
<TextBlock Text="More defaults" Style="{ThemeResource CaptionTextBlockStyle}"
Foreground="{ThemeResource SystemControlPageTextBaseMediumBrush}"/>
<TextBlock Text=" Likes" Style="{ThemeResource CaptionTextBlockStyle}"
Foreground="{ThemeResource SystemControlPageTextBaseMediumBrush}"/>
</StackPanel>
</StackPanel>
</Grid>
</DataTemplate>-->
</Page>

View File

@@ -1,161 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Label="Globals">
<ProjectGuid>{CA5CAD1A-0A1E-4F38-8704-9BFF1C37AA92}</ProjectGuid>
<ProjectName>TerminalSettingsControl</ProjectName>
<RootNamespace>Microsoft.Terminal.Settings.Control</RootNamespace>
<!-- cppwinrt.build.pre.props depends on these settings: -->
<!-- build a dll, not exe (Application) -->
<ConfigurationType>DynamicLibrary</ConfigurationType>
<SubSystem>Console</SubSystem>
<!-- sets a bunch of Windows Universal properties -->
<OpenConsoleUniversalApp>true</OpenConsoleUniversalApp>
<!-- C++/WinRT sets the depth to 1 if there is a XAML file in the project
Unfortunately for us, we need it to be 3. When the namespace merging
depth is 1, Microsoft.Terminal.Settings.Control becomes "Microsoft",
and our WinMD file becomes "Microsoft". Because WinRT is very
namespace-driven, this winmd is considered to contain the entire
Microsoft namespace. This is, obviously, not great. None of our other
projects compile properly when they depend on this "Microsoft.winmd."
-->
<CppWinRTNamespaceMergeDepth>4</CppWinRTNamespaceMergeDepth>
<!--
DON'T REDIRECT OUR OUTPUT.
Setting this will tell cppwinrt.build.post.props to copy our output from
the default OutDir up one level, so the wapproj will be able to find it.
-->
<NoOutputRedirection>true</NoOutputRedirection>
<XamlComponentResourceLocation>nested</XamlComponentResourceLocation>
<WindowsTargetPlatformVersion>10.0.18362.0</WindowsTargetPlatformVersion>
<WindowsTargetPlatformMinVersion>10.0.18362.0</WindowsTargetPlatformMinVersion>
</PropertyGroup>
<Import Project="..\..\..\common.openconsole.props" Condition="'$(OpenConsoleDir)'==''" />
<Import Project="$(OpenConsoleDir)src\cppwinrt.build.pre.props" />
<!-- Without this, the TerminalSettingsControl will forward the Microsoft.UI.XAML dependency upward and cause MDMerge to see the same type twicehttps
https://github.com/microsoft/microsoft-ui-xaml/issues/1573 -->
<ItemDefinitionGroup>
<Reference>
<Private Condition="'$(ConfigurationType)' != 'Application'">false</Private>
</Reference>
</ItemDefinitionGroup>
<ItemGroup>
<ClInclude Include="pch.h" />
<ClInclude Include="ColorSchemes.h">
<DependentUpon>ColorSchemes.xaml</DependentUpon>
</ClInclude>
<ClInclude Include="Globals.h">
<DependentUpon>Globals.xaml</DependentUpon>
</ClInclude>
<ClInclude Include="Keybindings.h">
<DependentUpon>Keybindings.xaml</DependentUpon>
</ClInclude>
<ClInclude Include="MainPage.h">
<DependentUpon>MainPage.xaml</DependentUpon>
</ClInclude>
<ClInclude Include="Profiles.h">
<DependentUpon>Profiles.xaml</DependentUpon>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="pch.cpp">
<PrecompiledHeader>Create</PrecompiledHeader>
</ClCompile>
<ClCompile Include="init.cpp" />
<ClCompile Include="ColorSchemes.cpp">
<DependentUpon>ColorSchemes.xaml</DependentUpon>
</ClCompile>
<ClCompile Include="Globals.cpp">
<DependentUpon>Globals.xaml</DependentUpon>
</ClCompile>
<ClCompile Include="Keybindings.cpp">
<DependentUpon>Keybindings.xaml</DependentUpon>
</ClCompile>
<ClCompile Include="MainPage.cpp">
<DependentUpon>MainPage.xaml</DependentUpon>
</ClCompile>
<ClCompile Include="Profiles.cpp">
<DependentUpon>Profiles.xaml</DependentUpon>
</ClCompile>
<ClCompile Include="$(GeneratedFilesDir)module.g.cpp" />
</ItemGroup>
<ItemGroup>
<Midl Include="ColorSchemes.idl">
<DependentUpon>ColorSchemes.xaml</DependentUpon>
</Midl>
<Midl Include="Globals.idl">
<DependentUpon>Globals.xaml</DependentUpon>
</Midl>
<Midl Include="Keybindings.idl">
<DependentUpon>Keybindings.xaml</DependentUpon>
</Midl>
<Midl Include="MainPage.idl">
<DependentUpon>MainPage.xaml</DependentUpon>
</Midl>
<Midl Include="Profiles.idl">
<DependentUpon>Profiles.xaml</DependentUpon>
</Midl>
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
<None Include="TerminalSettingsControl.def" />
</ItemGroup>
<ItemGroup>
<PRIResource Include="Resources\*\Resources.resw" />
</ItemGroup>
<!-- ========================= Project References ======================== -->
<ItemGroup>
<ProjectReference Include="..\..\types\lib\types.vcxproj" />
<ProjectReference Include="..\..\buffer\out\lib\bufferout.vcxproj" />
<ProjectReference Include="$(OpenConsoleDir)src\renderer\base\lib\base.vcxproj" />
<ProjectReference Include="..\..\renderer\dx\lib\dx.vcxproj" />
<ProjectReference Include="..\..\renderer\uia\lib\uia.vcxproj" />
<ProjectReference Include="..\..\terminal\parser\lib\parser.vcxproj" />
<ProjectReference Include="$(OpenConsoleDir)src\terminal\input\lib\terminalinput.vcxproj" />
<ProjectReference Include="$(OpenConsoleDir)src\cascadia\TerminalSettings\TerminalSettings.vcxproj">
<Private>false</Private>
<CopyLocalSatelliteAssemblies>false</CopyLocalSatelliteAssemblies>
</ProjectReference>
<ProjectReference Include="$(OpenConsoleDir)src\cascadia\TerminalCore\lib\TerminalCore-lib.vcxproj" />
<ProjectReference Include="$(OpenConsoleDir)src\cascadia\TerminalConnection\TerminalConnection.vcxproj">
<Private>false</Private>
<CopyLocalSatelliteAssemblies>false</CopyLocalSatelliteAssemblies>
</ProjectReference>
<ProjectReference Include="$(OpenConsoleDir)src\cascadia\WinRTUtils\WinRTUtils.vcxproj">
<Project>{CA5CAD1A-039A-4929-BA2A-8BEB2E4106FE}</Project>
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Page Include="ColorSchemes.xaml">
<SubType>Designer</SubType>
</Page>
<Page Include="Globals.xaml">
<SubType>Designer</SubType>
</Page>
<Page Include="Keybindings.xaml">
<SubType>Designer</SubType>
</Page>
<Page Include="MainPage.xaml">
<SubType>Designer</SubType>
</Page>
<Page Include="Profiles.xaml">
<SubType>Designer</SubType>
</Page>
</ItemGroup>
<Import Project="$(OpenConsoleDir)src\cppwinrt.build.post.props" />
<ItemDefinitionGroup>
<Link>
<AdditionalDependencies>dwrite.lib;dxgi.lib;d2d1.lib;d3d11.lib;shcore.lib;winmm.lib;pathcch.lib;propsys.lib;uiautomationcore.lib;Shlwapi.lib;ntdll.lib;user32.lib;kernel32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
<ClCompile>
<AdditionalIncludeDirectories>$(OpenConsoleDir)src\cascadia\inc;$(OpenConsoleDir)src\types\inc;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
</ItemDefinitionGroup>
<Import Project="..\..\..\packages\Microsoft.UI.Xaml.2.3.191217003-prerelease\build\native\Microsoft.UI.Xaml.targets" Condition="Exists('..\..\..\packages\Microsoft.UI.Xaml.2.3.191217003-prerelease\build\native\Microsoft.UI.Xaml.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\..\..\packages\Microsoft.UI.Xaml.2.3.191217003-prerelease\build\native\Microsoft.UI.Xaml.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\packages\Microsoft.UI.Xaml.2.3.191217003-prerelease\build\native\Microsoft.UI.Xaml.targets'))" />
</Target>
</Project>

View File

@@ -1,56 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Resources">
<UniqueIdentifier>accd3aa8-1ba0-4223-9bbe-0c431709210b</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tga;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
<Filter Include="Generated Files">
<UniqueIdentifier>{926ab91d-31b4-48c3-b9a4-e681349f27f0}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="pch.cpp" />
<ClCompile Include="$(GeneratedFilesDir)module.g.cpp" />
<ClCompile Include="ColorSchemes.cpp" />
<ClCompile Include="Globals.cpp" />
<ClCompile Include="Keybindings.cpp" />
<ClCompile Include="MainPage.cpp" />
<ClCompile Include="Profiles.cpp" />
<ClCompile Include="init.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="pch.h" />
<ClInclude Include="ColorSchemes.h" />
<ClInclude Include="Globals.h" />
<ClInclude Include="Keybindings.h" />
<ClInclude Include="MainPage.h" />
<ClInclude Include="Profiles.h" />
</ItemGroup>
<ItemGroup>
<Midl Include="ColorSchemes.idl" />
<Midl Include="Globals.idl" />
<Midl Include="Keybindings.idl" />
<Midl Include="MainPage.idl" />
<Midl Include="Profiles.idl" />
</ItemGroup>
<ItemGroup>
<None Include="TerminalSettingsControl.def" />
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<Page Include="ColorSchemes.xaml" />
<Page Include="Globals.xaml" />
<Page Include="Keybindings.xaml" />
<Page Include="MainPage.xaml" />
<Page Include="Profiles.xaml" />
</ItemGroup>
<ItemGroup>
<Natvis Include="$(SolutionDir)tools\ConsoleTypes.natvis" />
</ItemGroup>
<ItemGroup>
<PRIResource Include="Resources\*\Resources.resw">
<Filter>Resources</Filter>
</PRIResource>
</ItemGroup>
</Project>

View File

@@ -1,34 +0,0 @@
// Copyright (c) Microsoft Corporation
// Licensed under the MIT license.
#include "pch.h"
#include <LibraryResources.h>
// Note: Generate GUID using TlgGuid.exe tool
TRACELOGGING_DEFINE_PROVIDER(
g_hTerminalSettingsControlProvider,
"Microsoft.Windows.Terminal.Settings.Control",
// {58272983-4ad8-5de8-adbc-2db4810c3b21}
(0x58272983,0x4ad8,0x5de8,0xad,0xbc,0x2d,0xb4,0x81,0x0c,0x3b,0x21),
TraceLoggingOptionMicrosoftTelemetry());
BOOL WINAPI DllMain(HINSTANCE hInstDll, DWORD reason, LPVOID /*reserved*/)
{
switch (reason)
{
case DLL_PROCESS_ATTACH:
DisableThreadLibraryCalls(hInstDll);
TraceLoggingRegister(g_hTerminalSettingsControlProvider);
break;
case DLL_PROCESS_DETACH:
if (g_hTerminalSettingsControlProvider)
{
TraceLoggingUnregister(g_hTerminalSettingsControlProvider);
}
break;
}
return TRUE;
}
UTILS_DEFINE_LIBRARY_RESOURCE_SCOPE(L"Microsoft.Terminal.Settings.Control/Resources");

View File

@@ -1,5 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Microsoft.UI.Xaml" version="2.3.191217003-prerelease" targetFramework="native" />
<package id="Microsoft.Windows.CppWinRT" version="2.0.200316.3" targetFramework="native" />
</packages>

View File

@@ -1,4 +0,0 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
#include "pch.h"

View File

@@ -1,57 +0,0 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
//
// pch.h
// Header for platform projection include files
//
#pragma once
#define WIN32_LEAN_AND_MEAN
// Manually include til after we include Windows.Foundation to give it winrt superpowers
#define BLOCK_TIL
#include <LibraryIncludes.h>
// This is inexplicable, but for whatever reason, cppwinrt conflicts with the
// SDK definition of this function, so the only fix is to undef it.
// from WinBase.h
// Windows::UI::Xaml::Media::Animation::IStoryboard::GetCurrentTime
#ifdef GetCurrentTime
#undef GetCurrentTime
#endif
#include <wil/cppwinrt.h>
#include <unknwn.h>
#include <winrt/Windows.Foundation.h>
#include <winrt/Windows.Foundation.Collections.h>
#include <winrt/Windows.system.h>
#include <winrt/Windows.Graphics.Display.h>
#include <winrt/windows.ui.core.h>
#include <winrt/Windows.ui.input.h>
#include <winrt/Windows.UI.ViewManagement.h>
#include <winrt/Windows.UI.Xaml.h>
#include <winrt/Windows.UI.Xaml.Automation.Peers.h>
#include <winrt/Windows.UI.Text.Core.h>
#include <winrt/Windows.UI.Xaml.Controls.h>
#include <winrt/Windows.UI.Xaml.Controls.Primitives.h>
#include <winrt/Windows.UI.Xaml.Data.h>
#include <winrt/Windows.UI.Xaml.Media.h>
#include <winrt/Windows.UI.Xaml.Media.Imaging.h>
#include <winrt/Windows.UI.Xaml.Input.h>
#include <winrt/Windows.UI.Xaml.Interop.h>
#include <winrt/Windows.ui.xaml.markup.h>
#include <winrt/Windows.ApplicationModel.DataTransfer.h>
#include <winrt/Windows.Storage.h>
#include <winrt/Microsoft.UI.Xaml.Controls.h>
#include <winrt/Microsoft.UI.Xaml.Controls.Primitives.h>
#include <winrt/Microsoft.UI.Xaml.XamlTypeInfo.h>
#include <windows.ui.xaml.media.dxinterop.h>
#include <TraceLoggingProvider.h>
TRACELOGGING_DECLARE_PROVIDER(g_hTerminalControlProvider);
#include <telemetry/ProjectTelemetry.h>
#include "til.h"

View File

@@ -1,3 +0,0 @@
EXPORTS
DllCanUnloadNow = WINRT_CanUnloadNow PRIVATE
DllGetActivationFactory = WINRT_GetActivationFactory PRIVATE

View File

@@ -60,6 +60,9 @@ void ConsoleImeInfo::WriteCompMessage(const std::wstring_view text,
const std::basic_string_view<BYTE> attributes,
const std::basic_string_view<WORD> colorArray)
{
// Backup the cursor visibility state and turn it off for drawing.
_SaveCursorVisibility();
ClearAllAreas();
// Save copies of the composition message in case we need to redraw it as things scroll/resize
@@ -77,6 +80,8 @@ void ConsoleImeInfo::WriteCompMessage(const std::wstring_view text,
// - text - The actual text of what the user would like to insert (UTF-16)
void ConsoleImeInfo::WriteResultMessage(const std::wstring_view text)
{
_RestoreCursorVisibility();
ClearAllAreas();
_InsertConvertedString(text);
@@ -466,7 +471,7 @@ void ConsoleImeInfo::_InsertConvertedString(const std::wstring_view text)
// Routine Description:
// - Backs up the global cursor visibility state if it is shown and disables
// it while we work on the conversion areas.
void ConsoleImeInfo::SaveCursorVisibility()
void ConsoleImeInfo::_SaveCursorVisibility()
{
CONSOLE_INFORMATION& gci = ServiceLocator::LocateGlobals().getConsoleInformation();
Cursor& cursor = gci.GetActiveOutputBuffer().GetTextBuffer().GetCursor();
@@ -482,7 +487,7 @@ void ConsoleImeInfo::SaveCursorVisibility()
// Routine Description:
// - Restores the global cursor visibility state if it was on when it was backed up.
void ConsoleImeInfo::RestoreCursorVisibility()
void ConsoleImeInfo::_RestoreCursorVisibility()
{
if (_isSavedCursorVisible)
{

View File

@@ -55,9 +55,6 @@ public:
void RedrawCompMessage();
void SaveCursorVisibility();
void RestoreCursorVisibility();
private:
[[nodiscard]] HRESULT _AddConversionArea();
@@ -83,6 +80,8 @@ private:
const Microsoft::Console::Types::Viewport view,
SCREEN_INFORMATION& screenInfo);
void _SaveCursorVisibility();
void _RestoreCursorVisibility();
bool _isSavedCursorVisible;
std::wstring _text;

View File

@@ -104,9 +104,6 @@ void WriteConvRegionToScreen(const SCREEN_INFORMATION& ScreenInfo,
gci.LockConsole();
auto unlock = wil::scope_exit([&] { gci.UnlockConsole(); });
ConsoleImeInfo* const pIme = &gci.ConsoleIme;
pIme->SaveCursorVisibility();
gci.pInputBuffer->fInComposition = true;
return S_OK;
}
@@ -117,9 +114,6 @@ void WriteConvRegionToScreen(const SCREEN_INFORMATION& ScreenInfo,
gci.LockConsole();
auto unlock = wil::scope_exit([&] { gci.UnlockConsole(); });
ConsoleImeInfo* const pIme = &gci.ConsoleIme;
pIme->RestoreCursorVisibility();
gci.pInputBuffer->fInComposition = false;
return S_OK;
}

View File

@@ -142,6 +142,8 @@ try
// 1. Paint Background
RETURN_IF_FAILED(_PaintBackground(pEngine));
_PaintCursor(pEngine, true);
// 2. Paint Rows of Text
_PaintBufferOutput(pEngine);
@@ -698,13 +700,26 @@ void Renderer::_PaintBufferOutputHelper(_In_ IRenderEngine* const pEngine,
// when we go to draw gridlines for the length of the run.
const auto currentRunColor = color;
// Update the drawing brushes with our color.
THROW_IF_FAILED(_UpdateDrawingBrushes(pEngine, currentRunColor, false));
// Advance the point by however many columns we've just outputted and reset the accumulator.
screenPoint.X += gsl::narrow<SHORT>(cols);
cols = 0;
const bool isCursorRun = _cursorPos.has_value() && _cursorPos.value() == til::point{ screenPoint };
if (isCursorRun)
{
auto fakedAttrs = color;
THROW_IF_FAILED(pEngine->UpdateDrawingBrushes(_pData->GetForegroundColor(fakedAttrs),
0, // ARGB(0, 0, 0, 0),
fakedAttrs.GetLegacyAttributes(),
fakedAttrs.GetExtendedAttributes(),
false));
}
else
{
// Update the drawing brushes with our color.
THROW_IF_FAILED(_UpdateDrawingBrushes(pEngine, currentRunColor, false));
}
// Ensure that our cluster vector is clear.
clusters.clear();
@@ -717,7 +732,7 @@ void Renderer::_PaintBufferOutputHelper(_In_ IRenderEngine* const pEngine,
// When the color changes, it will save the new color off and break.
do
{
if (color != it->TextAttr())
if (!isCursorRun && color != it->TextAttr())
{
auto newAttr{ it->TextAttr() };
// foreground doesn't matter for runs of spaces (!)
@@ -725,7 +740,7 @@ void Renderer::_PaintBufferOutputHelper(_In_ IRenderEngine* const pEngine,
if (!_IsAllSpaces(it->Chars()) || !newAttr.HasIdenticalVisualRepresentationForBlankSpace(color, globalInvert))
{
color = newAttr;
break; // vend this run
break; // end this run
}
}
@@ -766,6 +781,13 @@ void Renderer::_PaintBufferOutputHelper(_In_ IRenderEngine* const pEngine,
it += columnCount > 0 ? columnCount : 1; // prevent infinite loop for no visible columns
cols += columnCount;
til::point newRunEnd{ screenPoint.X + gsl::narrow<SHORT>(cols), screenPoint.Y };
if (isCursorRun ||
(_cursorPos.has_value() && newRunEnd == _cursorPos.value()))
{
break;
}
} while (it);
// Do the painting.
@@ -845,7 +867,7 @@ void Renderer::_PaintBufferOutputGridLineHelper(_In_ IRenderEngine* const pEngin
// - <none>
// Return Value:
// - <none>
void Renderer::_PaintCursor(_In_ IRenderEngine* const pEngine)
void Renderer::_PaintCursor(_In_ IRenderEngine* const pEngine, const bool prePaint)
{
if (_pData->IsCursorVisible())
{
@@ -878,7 +900,20 @@ void Renderer::_PaintCursor(_In_ IRenderEngine* const pEngine)
options.isOn = _pData->IsCursorOn();
// Draw it within the viewport
LOG_IF_FAILED(pEngine->PaintCursor(options));
if (prePaint)
{
auto result = pEngine->PrePaintCursor(options);
LOG_IF_FAILED(result);
if (result != S_FALSE)
{
_cursorPos = coordCursor;
}
}
else
{
LOG_IF_FAILED(pEngine->PaintCursor(options));
_cursorPos = std::nullopt;
}
}
}
}

View File

@@ -86,6 +86,7 @@ namespace Microsoft::Console::Render
std::unique_ptr<IRenderThread> _pThread;
bool _destructing = false;
std::optional<til::point> _cursorPos{ std::nullopt };
void _NotifyPaintFrame();
@@ -110,7 +111,7 @@ namespace Microsoft::Console::Render
const COORD coordTarget);
void _PaintSelection(_In_ IRenderEngine* const pEngine);
void _PaintCursor(_In_ IRenderEngine* const pEngine);
void _PaintCursor(_In_ IRenderEngine* const pEngine, const bool prePaint = false);
void _PaintOverlays(_In_ IRenderEngine* const pEngine);
void _PaintOverlay(IRenderEngine& engine, const RenderOverlay& overlay);

View File

@@ -1420,6 +1420,11 @@ enum class CursorPaintType
Outline
};
[[nodiscard]] HRESULT DxEngine::PaintCursor(const IRenderEngine::CursorOptions& /*options*/) noexcept
{
return S_OK;
}
// Routine Description:
// - Draws a block at the given position to represent the cursor
// - May be a styled cursor at the character cell location that is less than a full block
@@ -1427,7 +1432,7 @@ enum class CursorPaintType
// - options - Packed options relevant to how to draw the cursor
// Return Value:
// - S_OK or relevant DirectX error.
[[nodiscard]] HRESULT DxEngine::PaintCursor(const IRenderEngine::CursorOptions& options) noexcept
[[nodiscard]] HRESULT DxEngine::PrePaintCursor(const IRenderEngine::CursorOptions& options) noexcept
try
{
// if the cursor is off, do nothing - it should not be visible.

View File

@@ -86,6 +86,7 @@ namespace Microsoft::Console::Render
[[nodiscard]] HRESULT PaintBufferGridLines(GridLines const lines, COLORREF const color, size_t const cchLine, COORD const coordTarget) noexcept override;
[[nodiscard]] HRESULT PaintSelection(const SMALL_RECT rect) noexcept override;
[[nodiscard]] HRESULT PrePaintCursor(const CursorOptions& options) noexcept override;
[[nodiscard]] HRESULT PaintCursor(const CursorOptions& options) noexcept override;
[[nodiscard]] HRESULT UpdateDrawingBrushes(COLORREF const colorForeground,

View File

@@ -101,6 +101,7 @@ namespace Microsoft::Console::Render
const COORD coordTarget) noexcept = 0;
[[nodiscard]] virtual HRESULT PaintSelection(const SMALL_RECT rect) noexcept = 0;
[[nodiscard]] virtual HRESULT PrePaintCursor(const CursorOptions& /*options*/) noexcept { return S_FALSE; };
[[nodiscard]] virtual HRESULT PaintCursor(const CursorOptions& options) noexcept = 0;
[[nodiscard]] virtual HRESULT UpdateDrawingBrushes(const COLORREF colorForeground,

View File

@@ -9,7 +9,6 @@
#undef WIN32_LEAN_AND_MEAN
#undef NOMINMAX
#define NOMINMAX
#include <stdexcept>
#include <string>
#include <string_view>
#include <array>