Merged PR 3315789: Migrate GitHub changes up until cfc72cee
*cfc72cee
(origin/dev/duhowett/ibxint, github/master) Make sure cursor blinks after opening new tab (1030) *9ad25440
Fix #936: misuse of uninitialized objects causes AppVerifier breaks on Windows Terminal startup (1015) *5f938a04
Update Terminal.cpp (1034) *4c47631b
Cleanup - termDispatch.hpp & adaptDispatch.hpp overrides (1004) *cc304759
add audit mode to ci (948) *80f10796
Fix the bell sound when Alt+key is pressed. (1006) *42e87ed3
fix build break from using `await` instead of `co_await` (1009) *40b557a4
Update manifest to correct 1903 version, unref param fix (1008) *0f62ec81
Eat all tap keypresses no matter what. (985) *ce0eaab9
inbox: Merge accumulated build fixes from RS_ONECORE_DEP_ACIOSS (1002) *1c509683
add .editorconfig file (585) *efd69990
Add support for OSC 10 and 11 to set the default colors (891) Related work items: #21610659, #21838182
This commit is contained in:
parent
c70f904922
commit
c910045187
13
.editorconfig
Normal file
13
.editorconfig
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
root = true
|
||||||
|
|
||||||
|
[*]
|
||||||
|
trim_trailing_whitespace = true
|
||||||
|
insert_final_newline = true
|
||||||
|
|
||||||
|
[{*.cpp,*.c,*.hpp,*.h,*.cs}]
|
||||||
|
indent_style = space
|
||||||
|
indent_size = 4
|
||||||
|
|
||||||
|
[*.json]
|
||||||
|
indent_style = space
|
||||||
|
indent_size = 2
|
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -18,7 +18,6 @@
|
||||||
x64/
|
x64/
|
||||||
x86/
|
x86/
|
||||||
ARM64/
|
ARM64/
|
||||||
build/
|
|
||||||
bld/
|
bld/
|
||||||
[Bb]in/
|
[Bb]in/
|
||||||
[Oo]bj/
|
[Oo]bj/
|
||||||
|
|
|
@ -19,6 +19,10 @@ pr:
|
||||||
name: 0.0.$(Date:yyMM).$(Date:dd)$(Rev:rr)
|
name: 0.0.$(Date:yyMM).$(Date:dd)$(Rev:rr)
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
- template: ./templates/build-console-audit-job.yml
|
||||||
|
parameters:
|
||||||
|
platform: x64
|
||||||
|
|
||||||
- template: ./templates/build-console-ci.yml
|
- template: ./templates/build-console-ci.yml
|
||||||
parameters:
|
parameters:
|
||||||
platform: x64
|
platform: x64
|
||||||
|
|
|
@ -16,6 +16,10 @@ variables:
|
||||||
name: 'Terminal_$(date:yyMM).$(date:dd)$(rev:rrr)'
|
name: 'Terminal_$(date:yyMM).$(date:dd)$(rev:rrr)'
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
- template: ./templates/build-console-audit-job.yml
|
||||||
|
parameters:
|
||||||
|
platform: x64
|
||||||
|
|
||||||
- template: ./templates/build-console-int.yml
|
- template: ./templates/build-console-int.yml
|
||||||
parameters:
|
parameters:
|
||||||
platform: x64
|
platform: x64
|
||||||
|
|
53
build/pipelines/templates/build-console-audit-job.yml
Normal file
53
build/pipelines/templates/build-console-audit-job.yml
Normal file
|
@ -0,0 +1,53 @@
|
||||||
|
parameters:
|
||||||
|
platform: ''
|
||||||
|
additionalBuildArguments: ''
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
- job: Build${{ parameters.platform }}AuditMode
|
||||||
|
displayName: Static Analysis Build ${{ parameters.platform }}
|
||||||
|
variables:
|
||||||
|
BuildConfiguration: AuditMode
|
||||||
|
BuildPlatform: ${{ parameters.platform }}
|
||||||
|
pool: { vmImage: vs2017-win2016 }
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- checkout: self
|
||||||
|
submodules: true
|
||||||
|
clean: true
|
||||||
|
|
||||||
|
- task: NuGetToolInstaller@0
|
||||||
|
displayName: Ensure NuGet 4.8.1
|
||||||
|
inputs:
|
||||||
|
versionSpec: 4.8.1
|
||||||
|
|
||||||
|
# In the Microsoft Azure DevOps tenant, NuGetCommand is ambiguous.
|
||||||
|
# This should be `task: NuGetCommand@2`
|
||||||
|
- task: 333b11bd-d341-40d9-afcf-b32d5ce6f23b@2
|
||||||
|
displayName: Restore NuGet packages
|
||||||
|
inputs:
|
||||||
|
command: restore
|
||||||
|
feedsToUse: config
|
||||||
|
configPath: NuGet.config
|
||||||
|
restoreSolution: OpenConsole.sln
|
||||||
|
restoreDirectory: '$(Build.SourcesDirectory)\packages'
|
||||||
|
|
||||||
|
- task: 333b11bd-d341-40d9-afcf-b32d5ce6f23b@2
|
||||||
|
displayName: 'NuGet restore packages for CI'
|
||||||
|
inputs:
|
||||||
|
command: restore
|
||||||
|
restoreSolution: build/.nuget/packages.config
|
||||||
|
feedsToUse: config
|
||||||
|
externalFeedCredentials: 'TAEF NuGet Feed'
|
||||||
|
nugetConfigPath: build/config/NuGet.config
|
||||||
|
restoreDirectory: '$(Build.SourcesDirectory)/packages'
|
||||||
|
|
||||||
|
- task: VSBuild@1
|
||||||
|
displayName: 'Build solution **\OpenConsole.sln'
|
||||||
|
inputs:
|
||||||
|
solution: '**\OpenConsole.sln'
|
||||||
|
vsVersion: 15.0
|
||||||
|
platform: '$(BuildPlatform)'
|
||||||
|
configuration: '$(BuildConfiguration)'
|
||||||
|
msbuildArgs: ${{ parameters.additionalBuildArguments }}
|
||||||
|
clean: true
|
||||||
|
maximumCpuCount: true
|
|
@ -4,8 +4,8 @@ parameters:
|
||||||
additionalBuildArguments: ''
|
additionalBuildArguments: ''
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
- job: Build${{ parameters.platform }}
|
- job: Build${{ parameters.platform }}${{ parameters.configuration }}
|
||||||
displayName: Build ${{ parameters.platform }}
|
displayName: Build ${{ parameters.platform }} ${{ parameters.configuration }}
|
||||||
variables:
|
variables:
|
||||||
BuildConfiguration: ${{ parameters.configuration }}
|
BuildConfiguration: ${{ parameters.configuration }}
|
||||||
BuildPlatform: ${{ parameters.platform }}
|
BuildPlatform: ${{ parameters.platform }}
|
||||||
|
|
|
@ -4,8 +4,8 @@ parameters:
|
||||||
additionalBuildArguments: ''
|
additionalBuildArguments: ''
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
- job: Build${{ parameters.platform }}
|
- job: Build${{ parameters.platform }}${{ parameters.configuration }}
|
||||||
displayName: Build ${{ parameters.platform }}
|
displayName: Build ${{ parameters.platform }} ${{ parameters.configuration }}
|
||||||
variables:
|
variables:
|
||||||
BuildConfiguration: ${{ parameters.configuration }}
|
BuildConfiguration: ${{ parameters.configuration }}
|
||||||
BuildPlatform: ${{ parameters.platform }}
|
BuildPlatform: ${{ parameters.platform }}
|
||||||
|
|
|
@ -6,16 +6,18 @@ jobs:
|
||||||
displayName: Sign and Deploy for ${{ parameters.configuration }}
|
displayName: Sign and Deploy for ${{ parameters.configuration }}
|
||||||
|
|
||||||
dependsOn:
|
dependsOn:
|
||||||
- Buildx64
|
- Buildx64AuditMode
|
||||||
- Buildx86
|
- Buildx64Release
|
||||||
- Buildarm64
|
- Buildx86Release
|
||||||
|
- Buildarm64Release
|
||||||
condition: |
|
condition: |
|
||||||
and
|
and
|
||||||
(
|
(
|
||||||
in(dependencies.Buildx64.result, 'Succeeded', 'SucceededWithIssues', 'Skipped'),
|
in(dependencies.Buildx64AuditMode.result, 'Succeeded', 'SucceededWithIssues', 'Skipped'),
|
||||||
in(dependencies.Buildx86.result, 'Succeeded', 'SucceededWithIssues', 'Skipped'),
|
in(dependencies.Buildx64Release.result, 'Succeeded', 'SucceededWithIssues', 'Skipped'),
|
||||||
in(dependencies.Buildarm64.result, 'Succeeded', 'SucceededWithIssues', 'Skipped')
|
in(dependencies.Buildx86Release.result, 'Succeeded', 'SucceededWithIssues', 'Skipped'),
|
||||||
)
|
in(dependencies.Buildarm64Release.result, 'Succeeded', 'SucceededWithIssues', 'Skipped')
|
||||||
|
)
|
||||||
|
|
||||||
variables:
|
variables:
|
||||||
BuildConfiguration: ${{ parameters.configuration }}
|
BuildConfiguration: ${{ parameters.configuration }}
|
||||||
|
|
|
@ -1,4 +1,11 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<RuleSet Name="Console Rules" Description="These rules enforce static analysis on console code." ToolsVersion="15.0">
|
<RuleSet Name="Console Rules" Description="These rules enforce static analysis on console code." ToolsVersion="15.0">
|
||||||
|
|
||||||
<Include Path="cppcorecheckrules.ruleset" Action="Default" />
|
<Include Path="cppcorecheckrules.ruleset" Action="Default" />
|
||||||
|
|
||||||
|
<Rules AnalyzerId="Microsoft.Analyzers.NativeCodeAnalysis" RuleNamespace="Microsoft.Rules.Native">
|
||||||
|
<Rule Id="C6001" Action="Error" />
|
||||||
|
<Rule Id="C6011" Action="Error" />
|
||||||
|
</Rules>
|
||||||
|
|
||||||
</RuleSet>
|
</RuleSet>
|
||||||
|
|
|
@ -21,7 +21,6 @@ Abstract:
|
||||||
#include "LibraryIncludes.h"
|
#include "LibraryIncludes.h"
|
||||||
|
|
||||||
#pragma warning(push)
|
#pragma warning(push)
|
||||||
#pragma warning(disable: ALL_CPPCORECHECK_WARNINGS)
|
|
||||||
#ifndef WIN32_LEAN_AND_MEAN
|
#ifndef WIN32_LEAN_AND_MEAN
|
||||||
#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
|
#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -211,7 +211,7 @@ namespace winrt::TerminalApp::implementation
|
||||||
_root.Children().Append(dialog);
|
_root.Children().Append(dialog);
|
||||||
|
|
||||||
// Display the dialog.
|
// Display the dialog.
|
||||||
Controls::ContentDialogResult result = await dialog.ShowAsync(Controls::ContentDialogPlacement::Popup);
|
Controls::ContentDialogResult result = co_await dialog.ShowAsync(Controls::ContentDialogPlacement::Popup);
|
||||||
|
|
||||||
// After the dialog is dismissed, the dialog lock (held by `lock`) will
|
// After the dialog is dismissed, the dialog lock (held by `lock`) will
|
||||||
// be released so another can be shown.
|
// be released so another can be shown.
|
||||||
|
@ -295,12 +295,12 @@ namespace winrt::TerminalApp::implementation
|
||||||
{
|
{
|
||||||
// enum value for ShortcutAction::NewTabProfileX; 0==NewTabProfile0
|
// enum value for ShortcutAction::NewTabProfileX; 0==NewTabProfile0
|
||||||
auto profileKeyChord = keyBindings.GetKeyBinding(static_cast<ShortcutAction>(profileIndex + static_cast<int>(ShortcutAction::NewTabProfile0)));
|
auto profileKeyChord = keyBindings.GetKeyBinding(static_cast<ShortcutAction>(profileIndex + static_cast<int>(ShortcutAction::NewTabProfile0)));
|
||||||
|
|
||||||
// make sure we find one to display
|
// make sure we find one to display
|
||||||
if (profileKeyChord)
|
if (profileKeyChord)
|
||||||
{
|
{
|
||||||
_SetAcceleratorForMenuItem(profileMenuItem, profileKeyChord);
|
_SetAcceleratorForMenuItem(profileMenuItem, profileKeyChord);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
auto profileName = profile.GetName();
|
auto profileName = profile.GetName();
|
||||||
|
|
|
@ -8,8 +8,6 @@
|
||||||
#include "App.g.h"
|
#include "App.g.h"
|
||||||
#include "../../cascadia/inc/cppwinrt_utils.h"
|
#include "../../cascadia/inc/cppwinrt_utils.h"
|
||||||
|
|
||||||
#include <wil/filesystem.h>
|
|
||||||
|
|
||||||
#include <winrt/Microsoft.Terminal.TerminalControl.h>
|
#include <winrt/Microsoft.Terminal.TerminalControl.h>
|
||||||
|
|
||||||
#include <winrt/Microsoft.UI.Xaml.Controls.h>
|
#include <winrt/Microsoft.UI.Xaml.Controls.h>
|
||||||
|
|
|
@ -6,8 +6,6 @@
|
||||||
#include "CascadiaSettings.h"
|
#include "CascadiaSettings.h"
|
||||||
#include "../../types/inc/utils.hpp"
|
#include "../../types/inc/utils.hpp"
|
||||||
#include <appmodel.h>
|
#include <appmodel.h>
|
||||||
#include <wil/com.h>
|
|
||||||
#include <wil/filesystem.h>
|
|
||||||
#include <shlobj.h>
|
#include <shlobj.h>
|
||||||
|
|
||||||
using namespace ::TerminalApp;
|
using namespace ::TerminalApp;
|
||||||
|
|
|
@ -14,4 +14,3 @@
|
||||||
|
|
||||||
#include "winrt/Windows.Foundation.h"
|
#include "winrt/Windows.Foundation.h"
|
||||||
#include <Windows.h>
|
#include <Windows.h>
|
||||||
#include <wil/result.h>
|
|
||||||
|
|
|
@ -158,8 +158,7 @@ namespace winrt::Microsoft::Terminal::TerminalControl::implementation
|
||||||
// - Style our UI elements based on the values in our _settings, and set up
|
// - Style our UI elements based on the values in our _settings, and set up
|
||||||
// other control-specific settings. This method will be called whenever
|
// other control-specific settings. This method will be called whenever
|
||||||
// the settings are reloaded.
|
// the settings are reloaded.
|
||||||
// * Sets up the background of the control with the provided BG color,
|
// * Calls _BackgroundColorChanged to style the background of the control
|
||||||
// acrylic or not, and if acrylic, then uses the opacity from _settings.
|
|
||||||
// - Core settings will be passed to the terminal in _InitializeTerminal
|
// - Core settings will be passed to the terminal in _InitializeTerminal
|
||||||
// Arguments:
|
// Arguments:
|
||||||
// - <none>
|
// - <none>
|
||||||
|
@ -167,37 +166,8 @@ namespace winrt::Microsoft::Terminal::TerminalControl::implementation
|
||||||
// - <none>
|
// - <none>
|
||||||
void TermControl::_ApplyUISettings()
|
void TermControl::_ApplyUISettings()
|
||||||
{
|
{
|
||||||
winrt::Windows::UI::Color bgColor{};
|
|
||||||
uint32_t bg = _settings.DefaultBackground();
|
uint32_t bg = _settings.DefaultBackground();
|
||||||
const auto R = GetRValue(bg);
|
_BackgroundColorChanged(bg);
|
||||||
const auto G = GetGValue(bg);
|
|
||||||
const auto B = GetBValue(bg);
|
|
||||||
bgColor.R = R;
|
|
||||||
bgColor.G = G;
|
|
||||||
bgColor.B = B;
|
|
||||||
bgColor.A = 255;
|
|
||||||
|
|
||||||
if (_settings.UseAcrylic())
|
|
||||||
{
|
|
||||||
Media::AcrylicBrush acrylic{};
|
|
||||||
acrylic.BackgroundSource(Media::AcrylicBackgroundSource::HostBackdrop);
|
|
||||||
acrylic.FallbackColor(bgColor);
|
|
||||||
acrylic.TintColor(bgColor);
|
|
||||||
acrylic.TintOpacity(_settings.TintOpacity());
|
|
||||||
_root.Background(acrylic);
|
|
||||||
|
|
||||||
// If we're acrylic, we want to make sure that the default BG color
|
|
||||||
// is transparent, so we can see the acrylic effect on text with the
|
|
||||||
// default BG color.
|
|
||||||
_settings.DefaultBackground(ARGB(0, R, G, B));
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Media::SolidColorBrush solidColor{};
|
|
||||||
solidColor.Color(bgColor);
|
|
||||||
_root.Background(solidColor);
|
|
||||||
_settings.DefaultBackground(RGB(R, G, B));
|
|
||||||
}
|
|
||||||
|
|
||||||
// Apply padding to the root Grid
|
// Apply padding to the root Grid
|
||||||
auto thickness = _ParseThicknessFromPadding(_settings.Padding());
|
auto thickness = _ParseThicknessFromPadding(_settings.Padding());
|
||||||
|
@ -216,6 +186,50 @@ namespace winrt::Microsoft::Terminal::TerminalControl::implementation
|
||||||
_desiredFont = { _actualFont };
|
_desiredFont = { _actualFont };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Method Description:
|
||||||
|
// - Style the background of the control with the provided background color
|
||||||
|
// - Respects the settings for acrylic and opacity from _settings
|
||||||
|
// Arguments:
|
||||||
|
// - color: The background color to use as a uint32 (aka DWORD COLORREF)
|
||||||
|
// Return Value:
|
||||||
|
// - <none>
|
||||||
|
void TermControl::_BackgroundColorChanged(const uint32_t color)
|
||||||
|
{
|
||||||
|
_root.Dispatcher().RunAsync(CoreDispatcherPriority::Normal, [this, color]() {
|
||||||
|
const auto R = GetRValue(color);
|
||||||
|
const auto G = GetGValue(color);
|
||||||
|
const auto B = GetBValue(color);
|
||||||
|
|
||||||
|
winrt::Windows::UI::Color bgColor{};
|
||||||
|
bgColor.R = R;
|
||||||
|
bgColor.G = G;
|
||||||
|
bgColor.B = B;
|
||||||
|
bgColor.A = 255;
|
||||||
|
|
||||||
|
if (_settings.UseAcrylic())
|
||||||
|
{
|
||||||
|
Media::AcrylicBrush acrylic{};
|
||||||
|
acrylic.BackgroundSource(Media::AcrylicBackgroundSource::HostBackdrop);
|
||||||
|
acrylic.FallbackColor(bgColor);
|
||||||
|
acrylic.TintColor(bgColor);
|
||||||
|
acrylic.TintOpacity(_settings.TintOpacity());
|
||||||
|
_root.Background(acrylic);
|
||||||
|
|
||||||
|
// If we're acrylic, we want to make sure that the default BG color
|
||||||
|
// is transparent, so we can see the acrylic effect on text with the
|
||||||
|
// default BG color.
|
||||||
|
_settings.DefaultBackground(ARGB(0, R, G, B));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Media::SolidColorBrush solidColor{};
|
||||||
|
solidColor.Color(bgColor);
|
||||||
|
_root.Background(solidColor);
|
||||||
|
_settings.DefaultBackground(RGB(R, G, B));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
// Method Description:
|
// Method Description:
|
||||||
// - Create a connection based on the values in our settings object.
|
// - Create a connection based on the values in our settings object.
|
||||||
// * Gets the commandline and working directory out of the _settings and
|
// * Gets the commandline and working directory out of the _settings and
|
||||||
|
@ -283,13 +297,19 @@ namespace winrt::Microsoft::Terminal::TerminalControl::implementation
|
||||||
_terminal = std::make_unique<::Microsoft::Terminal::Core::Terminal>();
|
_terminal = std::make_unique<::Microsoft::Terminal::Core::Terminal>();
|
||||||
|
|
||||||
// First create the render thread.
|
// First create the render thread.
|
||||||
|
// Then stash a local pointer to the render thread so we can initialize it and enable it
|
||||||
|
// to paint itself *after* we hand off its ownership to the renderer.
|
||||||
|
// We split up construction and initialization of the render thread object this way
|
||||||
|
// because the renderer and render thread have circular references to each other.
|
||||||
auto renderThread = std::make_unique<::Microsoft::Console::Render::RenderThread>();
|
auto renderThread = std::make_unique<::Microsoft::Console::Render::RenderThread>();
|
||||||
// Stash a local pointer to the render thread, so we can enable it after
|
|
||||||
// we hand off ownership to the renderer.
|
|
||||||
auto* const localPointerToThread = renderThread.get();
|
auto* const localPointerToThread = renderThread.get();
|
||||||
|
|
||||||
|
// Now create the renderer and initialize the render thread.
|
||||||
_renderer = std::make_unique<::Microsoft::Console::Render::Renderer>(_terminal.get(), nullptr, 0, std::move(renderThread));
|
_renderer = std::make_unique<::Microsoft::Console::Render::Renderer>(_terminal.get(), nullptr, 0, std::move(renderThread));
|
||||||
::Microsoft::Console::Render::IRenderTarget& renderTarget = *_renderer;
|
::Microsoft::Console::Render::IRenderTarget& renderTarget = *_renderer;
|
||||||
|
|
||||||
|
THROW_IF_FAILED(localPointerToThread->Initialize(_renderer.get()));
|
||||||
|
|
||||||
// Set up the DX Engine
|
// Set up the DX Engine
|
||||||
auto dxEngine = std::make_unique<::Microsoft::Console::Render::DxEngine>();
|
auto dxEngine = std::make_unique<::Microsoft::Console::Render::DxEngine>();
|
||||||
_renderer->AddRenderEngine(dxEngine.get());
|
_renderer->AddRenderEngine(dxEngine.get());
|
||||||
|
@ -336,8 +356,6 @@ namespace winrt::Microsoft::Terminal::TerminalControl::implementation
|
||||||
auto inputFn = std::bind(&TermControl::_SendInputToConnection, this, std::placeholders::_1);
|
auto inputFn = std::bind(&TermControl::_SendInputToConnection, this, std::placeholders::_1);
|
||||||
_terminal->SetWriteInputCallback(inputFn);
|
_terminal->SetWriteInputCallback(inputFn);
|
||||||
|
|
||||||
THROW_IF_FAILED(localPointerToThread->Initialize(_renderer.get()));
|
|
||||||
|
|
||||||
auto chain = _renderEngine->GetSwapChain();
|
auto chain = _renderEngine->GetSwapChain();
|
||||||
_swapChainPanel.Dispatcher().RunAsync(CoreDispatcherPriority::High, [this, chain]()
|
_swapChainPanel.Dispatcher().RunAsync(CoreDispatcherPriority::High, [this, chain]()
|
||||||
{
|
{
|
||||||
|
@ -406,6 +424,9 @@ namespace winrt::Microsoft::Terminal::TerminalControl::implementation
|
||||||
auto pfnTitleChanged = std::bind(&TermControl::_TerminalTitleChanged, this, std::placeholders::_1);
|
auto pfnTitleChanged = std::bind(&TermControl::_TerminalTitleChanged, this, std::placeholders::_1);
|
||||||
_terminal->SetTitleChangedCallback(pfnTitleChanged);
|
_terminal->SetTitleChangedCallback(pfnTitleChanged);
|
||||||
|
|
||||||
|
auto pfnBackgroundColorChanged = std::bind(&TermControl::_BackgroundColorChanged, this, std::placeholders::_1);
|
||||||
|
_terminal->SetBackgroundCallback(pfnBackgroundColorChanged);
|
||||||
|
|
||||||
auto pfnScrollPositionChanged = std::bind(&TermControl::_TerminalScrollPositionChanged, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3);
|
auto pfnScrollPositionChanged = std::bind(&TermControl::_TerminalScrollPositionChanged, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3);
|
||||||
_terminal->SetScrollPositionChangedCallback(pfnScrollPositionChanged);
|
_terminal->SetScrollPositionChangedCallback(pfnScrollPositionChanged);
|
||||||
|
|
||||||
|
@ -417,6 +438,7 @@ namespace winrt::Microsoft::Terminal::TerminalControl::implementation
|
||||||
_cursorTimer = std::make_optional(DispatcherTimer());
|
_cursorTimer = std::make_optional(DispatcherTimer());
|
||||||
_cursorTimer.value().Interval(std::chrono::milliseconds(blinkTime));
|
_cursorTimer.value().Interval(std::chrono::milliseconds(blinkTime));
|
||||||
_cursorTimer.value().Tick({ this, &TermControl::_BlinkCursor });
|
_cursorTimer.value().Tick({ this, &TermControl::_BlinkCursor });
|
||||||
|
_cursorTimer.value().Start();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -535,6 +557,14 @@ namespace winrt::Microsoft::Terminal::TerminalControl::implementation
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Manually prevent keyboard navigation with tab. We want to send tab to
|
||||||
|
// the terminal, and we don't want to be able to escape focus of the
|
||||||
|
// control with tab.
|
||||||
|
if (e.OriginalKey() == VirtualKey::Tab)
|
||||||
|
{
|
||||||
|
handled = true;
|
||||||
|
}
|
||||||
|
|
||||||
e.Handled(handled);
|
e.Handled(handled);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -830,7 +860,9 @@ namespace winrt::Microsoft::Terminal::TerminalControl::implementation
|
||||||
_focused = true;
|
_focused = true;
|
||||||
|
|
||||||
if (_cursorTimer.has_value())
|
if (_cursorTimer.has_value())
|
||||||
|
{
|
||||||
_cursorTimer.value().Start();
|
_cursorTimer.value().Start();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Method Description:
|
// Method Description:
|
||||||
|
|
|
@ -95,6 +95,7 @@ namespace winrt::Microsoft::Terminal::TerminalControl::implementation
|
||||||
|
|
||||||
void _Create();
|
void _Create();
|
||||||
void _ApplyUISettings();
|
void _ApplyUISettings();
|
||||||
|
void _BackgroundColorChanged(const uint32_t color);
|
||||||
void _ApplyConnectionSettings();
|
void _ApplyConnectionSettings();
|
||||||
void _InitializeTerminal();
|
void _InitializeTerminal();
|
||||||
void _UpdateFont();
|
void _UpdateFont();
|
||||||
|
|
|
@ -31,5 +31,8 @@ namespace Microsoft::Terminal::Core
|
||||||
virtual bool SetColorTableEntry(const size_t tableIndex, const DWORD dwColor) = 0;
|
virtual bool SetColorTableEntry(const size_t tableIndex, const DWORD dwColor) = 0;
|
||||||
|
|
||||||
virtual bool SetCursorStyle(const ::Microsoft::Console::VirtualTerminal::DispatchTypes::CursorStyle cursorStyle) = 0;
|
virtual bool SetCursorStyle(const ::Microsoft::Console::VirtualTerminal::DispatchTypes::CursorStyle cursorStyle) = 0;
|
||||||
|
|
||||||
|
virtual bool SetDefaultForeground(const DWORD dwColor) = 0;
|
||||||
|
virtual bool SetDefaultBackground(const DWORD dwColor) = 0;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -77,7 +77,7 @@ void Terminal::Create(COORD viewportSize, SHORT scrollbackLines, IRenderTarget&
|
||||||
}
|
}
|
||||||
|
|
||||||
// Method Description:
|
// Method Description:
|
||||||
// - Initializes the Temrinal from the given set of settings.
|
// - Initializes the Terminal from the given set of settings.
|
||||||
// Arguments:
|
// Arguments:
|
||||||
// - settings: the set of CoreSettings we need to use to initialize the terminal
|
// - settings: the set of CoreSettings we need to use to initialize the terminal
|
||||||
// - renderTarget: A render target the terminal can use for paint invalidation.
|
// - renderTarget: A render target the terminal can use for paint invalidation.
|
||||||
|
@ -442,6 +442,15 @@ void Terminal::SetScrollPositionChangedCallback(std::function<void(const int, co
|
||||||
_pfnScrollPositionChanged = pfn;
|
_pfnScrollPositionChanged = pfn;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Method Description:
|
||||||
|
// - Allows setting a callback for when the background color is changed
|
||||||
|
// Arguments:
|
||||||
|
// - pfn: a function callback that takes a uint32 (DWORD COLORREF) color in the format 0x00BBGGRR
|
||||||
|
void Terminal::SetBackgroundCallback(std::function<void(const uint32_t)> pfn) noexcept
|
||||||
|
{
|
||||||
|
_pfnBackgroundColorChanged = pfn;
|
||||||
|
}
|
||||||
|
|
||||||
// Method Description:
|
// Method Description:
|
||||||
// - Checks if selection is active
|
// - Checks if selection is active
|
||||||
// Return Value:
|
// Return Value:
|
||||||
|
|
|
@ -70,8 +70,10 @@ public:
|
||||||
COORD GetCursorPosition() override;
|
COORD GetCursorPosition() override;
|
||||||
bool EraseCharacters(const unsigned int numChars) override;
|
bool EraseCharacters(const unsigned int numChars) override;
|
||||||
bool SetWindowTitle(std::wstring_view title) override;
|
bool SetWindowTitle(std::wstring_view title) override;
|
||||||
bool SetColorTableEntry(const size_t tableIndex, const DWORD dwColor) override;
|
bool SetColorTableEntry(const size_t tableIndex, const COLORREF dwColor) override;
|
||||||
bool SetCursorStyle(const ::Microsoft::Console::VirtualTerminal::DispatchTypes::CursorStyle cursorStyle) override;
|
bool SetCursorStyle(const ::Microsoft::Console::VirtualTerminal::DispatchTypes::CursorStyle cursorStyle) override;
|
||||||
|
bool SetDefaultForeground(const COLORREF dwColor) override;
|
||||||
|
bool SetDefaultBackground(const COLORREF dwColor) override;
|
||||||
#pragma endregion
|
#pragma endregion
|
||||||
|
|
||||||
#pragma region ITerminalInput
|
#pragma region ITerminalInput
|
||||||
|
@ -113,6 +115,7 @@ public:
|
||||||
void SetWriteInputCallback(std::function<void(std::wstring&)> pfn) noexcept;
|
void SetWriteInputCallback(std::function<void(std::wstring&)> pfn) noexcept;
|
||||||
void SetTitleChangedCallback(std::function<void(const std::wstring_view&)> pfn) noexcept;
|
void SetTitleChangedCallback(std::function<void(const std::wstring_view&)> pfn) noexcept;
|
||||||
void SetScrollPositionChangedCallback(std::function<void(const int, const int, const int)> pfn) noexcept;
|
void SetScrollPositionChangedCallback(std::function<void(const int, const int, const int)> pfn) noexcept;
|
||||||
|
void SetBackgroundCallback(std::function<void(const uint32_t)> pfn) noexcept;
|
||||||
|
|
||||||
void SetCursorVisible(const bool isVisible) noexcept;
|
void SetCursorVisible(const bool isVisible) noexcept;
|
||||||
bool IsCursorBlinkingAllowed() const noexcept;
|
bool IsCursorBlinkingAllowed() const noexcept;
|
||||||
|
@ -131,6 +134,7 @@ public:
|
||||||
std::function<void(std::wstring&)> _pfnWriteInput;
|
std::function<void(std::wstring&)> _pfnWriteInput;
|
||||||
std::function<void(const std::wstring_view&)> _pfnTitleChanged;
|
std::function<void(const std::wstring_view&)> _pfnTitleChanged;
|
||||||
std::function<void(const int, const int, const int)> _pfnScrollPositionChanged;
|
std::function<void(const int, const int, const int)> _pfnScrollPositionChanged;
|
||||||
|
std::function<void(const uint32_t)> _pfnBackgroundColorChanged;
|
||||||
|
|
||||||
std::unique_ptr<::Microsoft::Console::VirtualTerminal::StateMachine> _stateMachine;
|
std::unique_ptr<::Microsoft::Console::VirtualTerminal::StateMachine> _stateMachine;
|
||||||
std::unique_ptr<::Microsoft::Console::VirtualTerminal::TerminalInput> _terminalInput;
|
std::unique_ptr<::Microsoft::Console::VirtualTerminal::TerminalInput> _terminalInput;
|
||||||
|
|
|
@ -157,7 +157,7 @@ bool Terminal::SetWindowTitle(std::wstring_view title)
|
||||||
// - dwColor: the new COLORREF to use as that color table value.
|
// - dwColor: the new COLORREF to use as that color table value.
|
||||||
// Return Value:
|
// Return Value:
|
||||||
// - true iff we successfully updated the color table entry.
|
// - true iff we successfully updated the color table entry.
|
||||||
bool Terminal::SetColorTableEntry(const size_t tableIndex, const DWORD dwColor)
|
bool Terminal::SetColorTableEntry(const size_t tableIndex, const COLORREF dwColor)
|
||||||
{
|
{
|
||||||
if (tableIndex > _colorTable.size())
|
if (tableIndex > _colorTable.size())
|
||||||
{
|
{
|
||||||
|
@ -219,3 +219,34 @@ bool Terminal::SetCursorStyle(const DispatchTypes::CursorStyle cursorStyle)
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Method Description:
|
||||||
|
// - Updates the default foreground color from a COLORREF, format 0x00BBGGRR.
|
||||||
|
// Arguments:
|
||||||
|
// - dwColor: the new COLORREF to use as the default foreground color
|
||||||
|
// Return Value:
|
||||||
|
// - true
|
||||||
|
bool Terminal::SetDefaultForeground(const COLORREF dwColor)
|
||||||
|
{
|
||||||
|
_defaultFg = dwColor;
|
||||||
|
|
||||||
|
// Repaint everything - the colors might have changed
|
||||||
|
_buffer->GetRenderTarget().TriggerRedrawAll();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Method Description:
|
||||||
|
// - Updates the default background color from a COLORREF, format 0x00BBGGRR.
|
||||||
|
// Arguments:
|
||||||
|
// - dwColor: the new COLORREF to use as the default background color
|
||||||
|
// Return Value:
|
||||||
|
// - true
|
||||||
|
bool Terminal::SetDefaultBackground(const COLORREF dwColor)
|
||||||
|
{
|
||||||
|
_defaultBg = dwColor;
|
||||||
|
_pfnBackgroundColorChanged(dwColor);
|
||||||
|
|
||||||
|
// Repaint everything - the colors might have changed
|
||||||
|
_buffer->GetRenderTarget().TriggerRedrawAll();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
|
@ -64,7 +64,7 @@ bool TerminalDispatch::SetWindowTitle(std::wstring_view title)
|
||||||
// - tableIndex: The VT color table index
|
// - tableIndex: The VT color table index
|
||||||
// - dwColor: The new RGB color value to use.
|
// - dwColor: The new RGB color value to use.
|
||||||
// Return Value:
|
// Return Value:
|
||||||
// True if handled successfully. False othewise.
|
// True if handled successfully. False otherwise.
|
||||||
bool TerminalDispatch::SetColorTableEntry(const size_t tableIndex,
|
bool TerminalDispatch::SetColorTableEntry(const size_t tableIndex,
|
||||||
const DWORD dwColor)
|
const DWORD dwColor)
|
||||||
{
|
{
|
||||||
|
@ -75,3 +75,25 @@ bool TerminalDispatch::SetCursorStyle(const DispatchTypes::CursorStyle cursorSty
|
||||||
{
|
{
|
||||||
return _terminalApi.SetCursorStyle(cursorStyle);
|
return _terminalApi.SetCursorStyle(cursorStyle);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Method Description:
|
||||||
|
// - Sets the default foreground color to a new value
|
||||||
|
// Arguments:
|
||||||
|
// - dwColor: The new RGB color value to use, in 0x00BBGGRR form
|
||||||
|
// Return Value:
|
||||||
|
// True if handled successfully. False otherwise.
|
||||||
|
bool TerminalDispatch::SetDefaultForeground(const DWORD dwColor)
|
||||||
|
{
|
||||||
|
return _terminalApi.SetDefaultForeground(dwColor);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Method Description:
|
||||||
|
// - Sets the default background color to a new value
|
||||||
|
// Arguments:
|
||||||
|
// - dwColor: The new RGB color value to use, in 0x00BBGGRR form
|
||||||
|
// Return Value:
|
||||||
|
// True if handled successfully. False otherwise.
|
||||||
|
bool TerminalDispatch::SetDefaultBackground(const DWORD dwColor)
|
||||||
|
{
|
||||||
|
return _terminalApi.SetDefaultBackground(dwColor);
|
||||||
|
}
|
||||||
|
|
|
@ -27,6 +27,9 @@ public:
|
||||||
bool SetColorTableEntry(const size_t tableIndex, const DWORD dwColor) override;
|
bool SetColorTableEntry(const size_t tableIndex, const DWORD dwColor) override;
|
||||||
bool SetCursorStyle(const ::Microsoft::Console::VirtualTerminal::DispatchTypes::CursorStyle cursorStyle) override;
|
bool SetCursorStyle(const ::Microsoft::Console::VirtualTerminal::DispatchTypes::CursorStyle cursorStyle) override;
|
||||||
|
|
||||||
|
bool SetDefaultForeground(const DWORD dwColor) override;
|
||||||
|
bool SetDefaultBackground(const DWORD dwColor) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
::Microsoft::Terminal::Core::ITerminalApi& _terminalApi;
|
::Microsoft::Terminal::Core::ITerminalApi& _terminalApi;
|
||||||
|
|
||||||
|
|
|
@ -162,6 +162,13 @@ LRESULT IslandWindow::MessageHandler(UINT const message, WPARAM const wparam, LP
|
||||||
return 0; // eat the message
|
return 0; // eat the message
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
case WM_MENUCHAR:
|
||||||
|
{
|
||||||
|
// GH#891: return this LRESULT here to prevent the app from making a
|
||||||
|
// bell when alt+key is pressed. A menu is active and the user presses a
|
||||||
|
// key that does not correspond to any mnemonic or accelerator key,
|
||||||
|
return MAKELRESULT(0, MNC_CLOSE);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: handle messages here...
|
// TODO: handle messages here...
|
||||||
|
@ -173,7 +180,7 @@ LRESULT IslandWindow::MessageHandler(UINT const message, WPARAM const wparam, LP
|
||||||
// Arguments:
|
// Arguments:
|
||||||
// - width: the new width of the window _in pixels_
|
// - width: the new width of the window _in pixels_
|
||||||
// - height: the new height of the window _in pixels_
|
// - height: the new height of the window _in pixels_
|
||||||
void IslandWindow::OnResize(const UINT width, const UINT height)
|
void IslandWindow::OnResize(const UINT /*width*/, const UINT /*height*/)
|
||||||
{
|
{
|
||||||
OnSize();
|
OnSize();
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,7 +2,10 @@
|
||||||
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
|
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
|
||||||
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
|
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
|
||||||
<application>
|
<application>
|
||||||
<maxversiontested Id="10.0.18295.0"/>
|
<!-- Windows 10 1903 -->
|
||||||
|
<!-- See https://docs.microsoft.com/en-us/windows/apps/desktop/modernize/xaml-islands -->
|
||||||
|
<maxversiontested Id="10.0.18362.0"/>
|
||||||
|
<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}" />
|
||||||
</application>
|
</application>
|
||||||
</compatibility>
|
</compatibility>
|
||||||
|
|
||||||
|
|
|
@ -25,4 +25,9 @@
|
||||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||||
</ImportGroup>
|
</ImportGroup>
|
||||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||||
|
<!-- Exclude our dependencies from static analysis. CAExcludePath can only be
|
||||||
|
set after we've imported Microsoft.Cpp.targets -->
|
||||||
|
<PropertyGroup>
|
||||||
|
<CAExcludePath>$(SolutionDir)\dep\;$(CAExcludePath)</CAExcludePath>
|
||||||
|
</PropertyGroup>
|
||||||
</Project>
|
</Project>
|
||||||
|
|
|
@ -113,8 +113,8 @@
|
||||||
<PreprocessorDefinitions>WIN32;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
<PreprocessorDefinitions>WIN32;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
</ItemDefinitionGroup>
|
</ItemDefinitionGroup>
|
||||||
<!-- For our Audit mode -->
|
<!-- For our Audit mode -->
|
||||||
<PropertyGroup Condition="'$(Configuration)'=='AuditMode'">
|
<PropertyGroup Condition="'$(Configuration)'=='AuditMode'">
|
||||||
<CodeAnalysisRuleSet>$(SolutionDir)\src\StaticAnalysis.ruleset</CodeAnalysisRuleSet>
|
<CodeAnalysisRuleSet>$(SolutionDir)\src\StaticAnalysis.ruleset</CodeAnalysisRuleSet>
|
||||||
<EnableCppCoreCheck>true</EnableCppCoreCheck>
|
<EnableCppCoreCheck>true</EnableCppCoreCheck>
|
||||||
<RunCodeAnalysis>true</RunCodeAnalysis>
|
<RunCodeAnalysis>true</RunCodeAnalysis>
|
||||||
|
|
|
@ -2170,3 +2170,59 @@ HRESULT DoSrvPrivateSetColorTableEntry(const short index, const COLORREF value)
|
||||||
CATCH_RETURN();
|
CATCH_RETURN();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Method Description:
|
||||||
|
// - Sets the default foreground color to the color specified in value.
|
||||||
|
// Arguments:
|
||||||
|
// - value: the new RGB value to use, as a COLORREF, format 0x00BBGGRR.
|
||||||
|
// Return Value:
|
||||||
|
// - S_OK
|
||||||
|
[[nodiscard]]
|
||||||
|
HRESULT DoSrvPrivateSetDefaultForegroundColor(const COLORREF value) noexcept
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
Globals& g = ServiceLocator::LocateGlobals();
|
||||||
|
CONSOLE_INFORMATION& gci = g.getConsoleInformation();
|
||||||
|
|
||||||
|
gci.SetDefaultForegroundColor(value);
|
||||||
|
|
||||||
|
// Update the screen colors if we're not a pty
|
||||||
|
// No need to force a redraw in pty mode.
|
||||||
|
if (g.pRender && !gci.IsInVtIoMode())
|
||||||
|
{
|
||||||
|
g.pRender->TriggerRedrawAll();
|
||||||
|
}
|
||||||
|
|
||||||
|
return S_OK;
|
||||||
|
}
|
||||||
|
CATCH_RETURN();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Method Description:
|
||||||
|
// - Sets the default background color to the color specified in value.
|
||||||
|
// Arguments:
|
||||||
|
// - value: the new RGB value to use, as a COLORREF, format 0x00BBGGRR.
|
||||||
|
// Return Value:
|
||||||
|
// - S_OK
|
||||||
|
[[nodiscard]]
|
||||||
|
HRESULT DoSrvPrivateSetDefaultBackgroundColor(const COLORREF value) noexcept
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
Globals& g = ServiceLocator::LocateGlobals();
|
||||||
|
CONSOLE_INFORMATION& gci = g.getConsoleInformation();
|
||||||
|
|
||||||
|
gci.SetDefaultBackgroundColor(value);
|
||||||
|
|
||||||
|
// Update the screen colors if we're not a pty
|
||||||
|
// No need to force a redraw in pty mode.
|
||||||
|
if (g.pRender && !gci.IsInVtIoMode())
|
||||||
|
{
|
||||||
|
g.pRender->TriggerRedrawAll();
|
||||||
|
}
|
||||||
|
|
||||||
|
return S_OK;
|
||||||
|
}
|
||||||
|
CATCH_RETURN();
|
||||||
|
}
|
||||||
|
|
|
@ -99,3 +99,9 @@ void DoSrvPrivateMoveToBottom(SCREEN_INFORMATION& screenInfo);
|
||||||
|
|
||||||
[[nodiscard]]
|
[[nodiscard]]
|
||||||
HRESULT DoSrvPrivateSetColorTableEntry(const short index, const COLORREF value) noexcept;
|
HRESULT DoSrvPrivateSetColorTableEntry(const short index, const COLORREF value) noexcept;
|
||||||
|
|
||||||
|
[[nodiscard]]
|
||||||
|
HRESULT DoSrvPrivateSetDefaultForegroundColor(const COLORREF value) noexcept;
|
||||||
|
|
||||||
|
[[nodiscard]]
|
||||||
|
HRESULT DoSrvPrivateSetDefaultBackgroundColor(const COLORREF value) noexcept;
|
||||||
|
|
|
@ -761,3 +761,27 @@ BOOL ConhostInternalGetSet::PrivateSetColorTableEntry(const short index, const C
|
||||||
{
|
{
|
||||||
return SUCCEEDED(DoSrvPrivateSetColorTableEntry(index, value));
|
return SUCCEEDED(DoSrvPrivateSetColorTableEntry(index, value));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Method Description:
|
||||||
|
// - Connects the PrivateSetDefaultForeground call directly into our Driver Message servicing
|
||||||
|
// call inside Conhost.exe
|
||||||
|
// Arguments:
|
||||||
|
// - value: the new RGB value to use, as a COLORREF, format 0x00BBGGRR.
|
||||||
|
// Return Value:
|
||||||
|
// - TRUE if successful (see DoSrvPrivateSetDefaultForegroundColor). FALSE otherwise.
|
||||||
|
BOOL ConhostInternalGetSet::PrivateSetDefaultForeground(const COLORREF value) const noexcept
|
||||||
|
{
|
||||||
|
return SUCCEEDED(DoSrvPrivateSetDefaultForegroundColor(value));
|
||||||
|
}
|
||||||
|
|
||||||
|
// Method Description:
|
||||||
|
// - Connects the PrivateSetDefaultBackground call directly into our Driver Message servicing
|
||||||
|
// call inside Conhost.exe
|
||||||
|
// Arguments:
|
||||||
|
// - value: the new RGB value to use, as a COLORREF, format 0x00BBGGRR.
|
||||||
|
// Return Value:
|
||||||
|
// - TRUE if successful (see DoSrvPrivateSetDefaultBackgroundColor). FALSE otherwise.
|
||||||
|
BOOL ConhostInternalGetSet::PrivateSetDefaultBackground(const COLORREF value) const noexcept
|
||||||
|
{
|
||||||
|
return SUCCEEDED(DoSrvPrivateSetDefaultBackgroundColor(value));
|
||||||
|
}
|
||||||
|
|
|
@ -157,6 +157,10 @@ public:
|
||||||
|
|
||||||
BOOL PrivateSetColorTableEntry(const short index, const COLORREF value) const noexcept override;
|
BOOL PrivateSetColorTableEntry(const short index, const COLORREF value) const noexcept override;
|
||||||
|
|
||||||
|
BOOL PrivateSetDefaultForeground(const COLORREF value) const noexcept override;
|
||||||
|
|
||||||
|
BOOL PrivateSetDefaultBackground(const COLORREF value) const noexcept override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Microsoft::Console::IIoProvider& _io;
|
Microsoft::Console::IIoProvider& _io;
|
||||||
};
|
};
|
||||||
|
|
|
@ -149,6 +149,10 @@ class ScreenBufferTests
|
||||||
|
|
||||||
TEST_METHOD(SetColorTableThreeDigits);
|
TEST_METHOD(SetColorTableThreeDigits);
|
||||||
|
|
||||||
|
TEST_METHOD(SetDefaultForegroundColor);
|
||||||
|
|
||||||
|
TEST_METHOD(SetDefaultBackgroundColor);
|
||||||
|
|
||||||
TEST_METHOD(DeleteCharsNearEndOfLine);
|
TEST_METHOD(DeleteCharsNearEndOfLine);
|
||||||
TEST_METHOD(DeleteCharsNearEndOfLineSimpleFirstCase);
|
TEST_METHOD(DeleteCharsNearEndOfLineSimpleFirstCase);
|
||||||
TEST_METHOD(DeleteCharsNearEndOfLineSimpleSecondCase);
|
TEST_METHOD(DeleteCharsNearEndOfLineSimpleSecondCase);
|
||||||
|
@ -2502,6 +2506,126 @@ void ScreenBufferTests::SetColorTableThreeDigits()
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void ScreenBufferTests::SetDefaultForegroundColor()
|
||||||
|
{
|
||||||
|
// Setting the default foreground color should work
|
||||||
|
|
||||||
|
CONSOLE_INFORMATION& gci = ServiceLocator::LocateGlobals().getConsoleInformation();
|
||||||
|
gci.LockConsole(); // Lock must be taken to swap buffers.
|
||||||
|
auto unlock = wil::scope_exit([&] { gci.UnlockConsole(); });
|
||||||
|
|
||||||
|
SCREEN_INFORMATION& mainBuffer = gci.GetActiveOutputBuffer();
|
||||||
|
VERIFY_IS_FALSE(mainBuffer._IsAltBuffer());
|
||||||
|
WI_SetFlag(mainBuffer.OutputMode, ENABLE_VIRTUAL_TERMINAL_PROCESSING);
|
||||||
|
VERIFY_IS_TRUE(WI_IsFlagSet(mainBuffer.OutputMode, ENABLE_VIRTUAL_TERMINAL_PROCESSING));
|
||||||
|
|
||||||
|
StateMachine& stateMachine = mainBuffer.GetStateMachine();
|
||||||
|
|
||||||
|
COLORREF originalColor = gci.GetDefaultForegroundColor();
|
||||||
|
COLORREF newColor = gci.GetDefaultForegroundColor();
|
||||||
|
COLORREF testColor = RGB(0x33, 0x66, 0x99);
|
||||||
|
VERIFY_ARE_NOT_EQUAL(originalColor, testColor);
|
||||||
|
|
||||||
|
Log::Comment(L"Valid Hexadecimal Notation");
|
||||||
|
std::wstring seq = L"\x1b]10;rgb:33/66/99\x1b\\";
|
||||||
|
stateMachine.ProcessString(seq);
|
||||||
|
|
||||||
|
newColor = gci.GetDefaultForegroundColor();
|
||||||
|
VERIFY_ARE_EQUAL(testColor, newColor);
|
||||||
|
|
||||||
|
Log::Comment(L"Valid Hexadecimal Notation");
|
||||||
|
originalColor = newColor;
|
||||||
|
testColor = RGB(0xff, 0xff, 0xff);
|
||||||
|
seq = L"\x1b]10;rgb:ff/ff/ff\x1b\\";
|
||||||
|
stateMachine.ProcessString(seq);
|
||||||
|
|
||||||
|
newColor = gci.GetDefaultForegroundColor();
|
||||||
|
VERIFY_ARE_EQUAL(testColor, newColor);
|
||||||
|
|
||||||
|
Log::Comment(L"Invalid Decimal Notation");
|
||||||
|
originalColor = newColor;
|
||||||
|
testColor = RGB(153, 102, 51);
|
||||||
|
seq = L"\x1b]10;rgb:153/102/51\x1b\\";
|
||||||
|
stateMachine.ProcessString(seq);
|
||||||
|
|
||||||
|
newColor = gci.GetDefaultForegroundColor();
|
||||||
|
VERIFY_ARE_NOT_EQUAL(testColor, newColor);
|
||||||
|
// it will, in fact leave the color the way it was
|
||||||
|
VERIFY_ARE_EQUAL(originalColor, newColor);
|
||||||
|
|
||||||
|
Log::Comment(L"Invalid syntax");
|
||||||
|
testColor = RGB(153, 102, 51);
|
||||||
|
seq = L"\x1b]10;99/66/33\x1b\\";
|
||||||
|
stateMachine.ProcessString(seq);
|
||||||
|
|
||||||
|
newColor = gci.GetDefaultForegroundColor();
|
||||||
|
VERIFY_ARE_NOT_EQUAL(testColor, newColor);
|
||||||
|
// it will, in fact leave the color the way it was
|
||||||
|
VERIFY_ARE_EQUAL(originalColor, newColor);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void ScreenBufferTests::SetDefaultBackgroundColor()
|
||||||
|
{
|
||||||
|
// Setting the default Background color should work
|
||||||
|
|
||||||
|
CONSOLE_INFORMATION& gci = ServiceLocator::LocateGlobals().getConsoleInformation();
|
||||||
|
gci.LockConsole(); // Lock must be taken to swap buffers.
|
||||||
|
auto unlock = wil::scope_exit([&] { gci.UnlockConsole(); });
|
||||||
|
|
||||||
|
SCREEN_INFORMATION& mainBuffer = gci.GetActiveOutputBuffer();
|
||||||
|
VERIFY_IS_FALSE(mainBuffer._IsAltBuffer());
|
||||||
|
WI_SetFlag(mainBuffer.OutputMode, ENABLE_VIRTUAL_TERMINAL_PROCESSING);
|
||||||
|
VERIFY_IS_TRUE(WI_IsFlagSet(mainBuffer.OutputMode, ENABLE_VIRTUAL_TERMINAL_PROCESSING));
|
||||||
|
|
||||||
|
StateMachine& stateMachine = mainBuffer.GetStateMachine();
|
||||||
|
|
||||||
|
COLORREF originalColor = gci.GetDefaultBackgroundColor();
|
||||||
|
COLORREF newColor = gci.GetDefaultBackgroundColor();
|
||||||
|
COLORREF testColor = RGB(0x33, 0x66, 0x99);
|
||||||
|
VERIFY_ARE_NOT_EQUAL(originalColor, testColor);
|
||||||
|
|
||||||
|
Log::Comment(L"Valid Hexadecimal Notation");
|
||||||
|
std::wstring seq = L"\x1b]11;rgb:33/66/99\x1b\\";
|
||||||
|
stateMachine.ProcessString(seq);
|
||||||
|
|
||||||
|
newColor = gci.GetDefaultBackgroundColor();
|
||||||
|
VERIFY_ARE_EQUAL(testColor, newColor);
|
||||||
|
|
||||||
|
Log::Comment(L"Valid Hexadecimal Notation");
|
||||||
|
originalColor = newColor;
|
||||||
|
testColor = RGB(0xff, 0xff, 0xff);
|
||||||
|
seq = L"\x1b]11;rgb:ff/ff/ff\x1b\\";
|
||||||
|
stateMachine.ProcessString(seq);
|
||||||
|
|
||||||
|
newColor = gci.GetDefaultBackgroundColor();
|
||||||
|
VERIFY_ARE_EQUAL(testColor, newColor);
|
||||||
|
|
||||||
|
Log::Comment(L"Invalid Decimal Notation");
|
||||||
|
originalColor = newColor;
|
||||||
|
testColor = RGB(153, 102, 51);
|
||||||
|
seq = L"\x1b]11;rgb:153/102/51\x1b\\";
|
||||||
|
stateMachine.ProcessString(seq);
|
||||||
|
|
||||||
|
newColor = gci.GetDefaultBackgroundColor();
|
||||||
|
VERIFY_ARE_NOT_EQUAL(testColor, newColor);
|
||||||
|
// it will, in fact leave the color the way it was
|
||||||
|
VERIFY_ARE_EQUAL(originalColor, newColor);
|
||||||
|
|
||||||
|
Log::Comment(L"Invalid Syntax");
|
||||||
|
testColor = RGB(153, 102, 51);
|
||||||
|
seq = L"\x1b]11;99/66/33\x1b\\";
|
||||||
|
stateMachine.ProcessString(seq);
|
||||||
|
|
||||||
|
newColor = gci.GetDefaultBackgroundColor();
|
||||||
|
VERIFY_ARE_NOT_EQUAL(testColor, newColor);
|
||||||
|
// it will, in fact leave the color the way it was
|
||||||
|
VERIFY_ARE_EQUAL(originalColor, newColor);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void ScreenBufferTests::DeleteCharsNearEndOfLine()
|
void ScreenBufferTests::DeleteCharsNearEndOfLine()
|
||||||
{
|
{
|
||||||
// Created for MSFT:19888564.
|
// Created for MSFT:19888564.
|
||||||
|
|
|
@ -3,10 +3,8 @@
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <CppCoreCheck/Warnings.h>
|
|
||||||
|
|
||||||
#pragma warning(push)
|
#pragma warning(push)
|
||||||
#pragma warning(disable: ALL_CPPCORECHECK_WARNINGS)
|
|
||||||
|
|
||||||
// C
|
// C
|
||||||
#include <climits>
|
#include <climits>
|
||||||
|
@ -44,12 +42,12 @@
|
||||||
#include <functional>
|
#include <functional>
|
||||||
|
|
||||||
// WIL
|
// WIL
|
||||||
|
|
||||||
#include <wil/Common.h>
|
#include <wil/Common.h>
|
||||||
#include <wil/Result.h>
|
#include <wil/Result.h>
|
||||||
#include <wil/resource.h>
|
#include <wil/resource.h>
|
||||||
#include <wil/wistd_memory.h>
|
#include <wil/wistd_memory.h>
|
||||||
#include <wil/com.h>
|
#include <wil/com.h>
|
||||||
|
#include <wil/filesystem.h>
|
||||||
|
|
||||||
// GSL
|
// GSL
|
||||||
// Block GSL Multi Span include because it both has C++17 deprecated iterators
|
// Block GSL Multi Span include because it both has C++17 deprecated iterators
|
||||||
|
@ -57,6 +55,9 @@
|
||||||
#define GSL_MULTI_SPAN_H
|
#define GSL_MULTI_SPAN_H
|
||||||
#include <gsl/gsl>
|
#include <gsl/gsl>
|
||||||
|
|
||||||
|
// CppCoreCheck
|
||||||
|
#include <CppCoreCheck/Warnings.h>
|
||||||
|
|
||||||
// IntSafe
|
// IntSafe
|
||||||
#define ENABLE_INTSAFE_SIGNED_FUNCTIONS
|
#define ENABLE_INTSAFE_SIGNED_FUNCTIONS
|
||||||
#include <intsafe.h>
|
#include <intsafe.h>
|
||||||
|
|
|
@ -48,12 +48,7 @@
|
||||||
#include "strid.h"
|
#include "strid.h"
|
||||||
#include "..\propslib\conpropsp.hpp"
|
#include "..\propslib\conpropsp.hpp"
|
||||||
|
|
||||||
// WIL
|
|
||||||
#include <new>
|
#include <new>
|
||||||
#include <wil/Common.h>
|
|
||||||
#include <wil/Result.h>
|
|
||||||
#include <wil/resource.h>
|
|
||||||
#include <wil/wistd_memory.h>
|
|
||||||
|
|
||||||
// This is currently bubbling up the source tree to our branch
|
// This is currently bubbling up the source tree to our branch
|
||||||
#ifndef WM_DPICHANGED_BEFOREPARENT
|
#ifndef WM_DPICHANGED_BEFOREPARENT
|
||||||
|
|
|
@ -12,42 +12,42 @@ using namespace Microsoft::Console::Render;
|
||||||
|
|
||||||
RenderThread::RenderThread() :
|
RenderThread::RenderThread() :
|
||||||
_pRenderer(nullptr),
|
_pRenderer(nullptr),
|
||||||
_hThread(INVALID_HANDLE_VALUE),
|
_hThread(nullptr),
|
||||||
_hEvent(INVALID_HANDLE_VALUE),
|
_hEvent(nullptr),
|
||||||
_hPaintCompletedEvent(INVALID_HANDLE_VALUE),
|
_hPaintCompletedEvent(nullptr),
|
||||||
_fKeepRunning(true),
|
_fKeepRunning(true),
|
||||||
_hPaintEnabledEvent(INVALID_HANDLE_VALUE)
|
_hPaintEnabledEvent(nullptr)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
RenderThread::~RenderThread()
|
RenderThread::~RenderThread()
|
||||||
{
|
{
|
||||||
if (_hThread != INVALID_HANDLE_VALUE)
|
if (_hThread)
|
||||||
{
|
{
|
||||||
_fKeepRunning = false; // stop loop after final run
|
_fKeepRunning = false; // stop loop after final run
|
||||||
SignalObjectAndWait(_hEvent, _hThread, INFINITE, FALSE); // signal final paint and wait for thread to finish.
|
SignalObjectAndWait(_hEvent, _hThread, INFINITE, FALSE); // signal final paint and wait for thread to finish.
|
||||||
|
|
||||||
CloseHandle(_hThread);
|
CloseHandle(_hThread);
|
||||||
_hThread = INVALID_HANDLE_VALUE;
|
_hThread = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_hEvent != INVALID_HANDLE_VALUE)
|
if (_hEvent)
|
||||||
{
|
{
|
||||||
CloseHandle(_hEvent);
|
CloseHandle(_hEvent);
|
||||||
_hEvent = INVALID_HANDLE_VALUE;
|
_hEvent = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_hPaintEnabledEvent != INVALID_HANDLE_VALUE)
|
if (_hPaintEnabledEvent)
|
||||||
{
|
{
|
||||||
CloseHandle(_hPaintEnabledEvent);
|
CloseHandle(_hPaintEnabledEvent);
|
||||||
_hPaintEnabledEvent = INVALID_HANDLE_VALUE;
|
_hPaintEnabledEvent = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_hPaintCompletedEvent != INVALID_HANDLE_VALUE)
|
if (_hPaintCompletedEvent)
|
||||||
{
|
{
|
||||||
CloseHandle(_hPaintCompletedEvent);
|
CloseHandle(_hPaintCompletedEvent);
|
||||||
_hPaintCompletedEvent = INVALID_HANDLE_VALUE;
|
_hPaintCompletedEvent = nullptr;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -65,6 +65,8 @@ public:
|
||||||
virtual bool EnableAnyEventMouseMode(const bool fEnabled) = 0; // ?1003
|
virtual bool EnableAnyEventMouseMode(const bool fEnabled) = 0; // ?1003
|
||||||
virtual bool EnableAlternateScroll(const bool fEnabled) = 0; // ?1007
|
virtual bool EnableAlternateScroll(const bool fEnabled) = 0; // ?1007
|
||||||
virtual bool SetColorTableEntry(const size_t tableIndex, const DWORD dwColor) = 0; // OSCColorTable
|
virtual bool SetColorTableEntry(const size_t tableIndex, const DWORD dwColor) = 0; // OSCColorTable
|
||||||
|
virtual bool SetDefaultForeground(const DWORD dwColor) = 0; // OSCDefaultForeground
|
||||||
|
virtual bool SetDefaultBackground(const DWORD dwColor) = 0; // OSCDefaultBackground
|
||||||
|
|
||||||
virtual bool EraseInDisplay(const DispatchTypes::EraseType eraseType) = 0; // ED
|
virtual bool EraseInDisplay(const DispatchTypes::EraseType eraseType) = 0; // ED
|
||||||
virtual bool EraseInLine(const DispatchTypes::EraseType eraseType) = 0; // EL
|
virtual bool EraseInLine(const DispatchTypes::EraseType eraseType) = 0; // EL
|
||||||
|
@ -97,4 +99,3 @@ public:
|
||||||
|
|
||||||
};
|
};
|
||||||
inline Microsoft::Console::VirtualTerminal::ITermDispatch::~ITermDispatch() { }
|
inline Microsoft::Console::VirtualTerminal::ITermDispatch::~ITermDispatch() { }
|
||||||
|
|
||||||
|
|
|
@ -26,16 +26,16 @@ namespace Microsoft::Console::VirtualTerminal
|
||||||
|
|
||||||
InteractDispatch(ConGetSet* const pConApi);
|
InteractDispatch(ConGetSet* const pConApi);
|
||||||
|
|
||||||
virtual ~InteractDispatch() override = default;
|
~InteractDispatch() = default;
|
||||||
|
|
||||||
virtual bool WriteInput(_In_ std::deque<std::unique_ptr<IInputEvent>>& inputEvents) override;
|
bool WriteInput(_In_ std::deque<std::unique_ptr<IInputEvent>>& inputEvents) override;
|
||||||
virtual bool WriteCtrlC() override;
|
bool WriteCtrlC() override;
|
||||||
virtual bool WriteString(_In_reads_(cch) const wchar_t* const pws, const size_t cch) override;
|
bool WriteString(_In_reads_(cch) const wchar_t* const pws, const size_t cch) override;
|
||||||
virtual bool WindowManipulation(const DispatchTypes::WindowManipulationType uiFunction,
|
bool WindowManipulation(const DispatchTypes::WindowManipulationType uiFunction,
|
||||||
_In_reads_(cParams) const unsigned short* const rgusParams,
|
_In_reads_(cParams) const unsigned short* const rgusParams,
|
||||||
const size_t cParams) override; // DTTERM_WindowManipulation
|
const size_t cParams) override; // DTTERM_WindowManipulation
|
||||||
virtual bool MoveCursor(const unsigned int row,
|
bool MoveCursor(const unsigned int row,
|
||||||
const unsigned int col) override;
|
const unsigned int col) override;
|
||||||
private:
|
private:
|
||||||
|
|
||||||
std::unique_ptr<ConGetSet> _pConApi;
|
std::unique_ptr<ConGetSet> _pConApi;
|
||||||
|
|
|
@ -1389,7 +1389,7 @@ bool AdaptDispatch::UseMainScreenBuffer()
|
||||||
//Arguments:
|
//Arguments:
|
||||||
// - None
|
// - None
|
||||||
// Return value:
|
// Return value:
|
||||||
// True if handled successfully. False othewise.
|
// True if handled successfully. False otherwise.
|
||||||
bool AdaptDispatch::HorizontalTabSet()
|
bool AdaptDispatch::HorizontalTabSet()
|
||||||
{
|
{
|
||||||
return !!_conApi->PrivateHorizontalTabSet();
|
return !!_conApi->PrivateHorizontalTabSet();
|
||||||
|
@ -1403,7 +1403,7 @@ bool AdaptDispatch::HorizontalTabSet()
|
||||||
//Arguments:
|
//Arguments:
|
||||||
// - sNumTabs - the number of tabs to perform
|
// - sNumTabs - the number of tabs to perform
|
||||||
// Return value:
|
// Return value:
|
||||||
// True if handled successfully. False othewise.
|
// True if handled successfully. False otherwise.
|
||||||
bool AdaptDispatch::ForwardTab(const SHORT sNumTabs)
|
bool AdaptDispatch::ForwardTab(const SHORT sNumTabs)
|
||||||
{
|
{
|
||||||
return !!_conApi->PrivateForwardTab(sNumTabs);
|
return !!_conApi->PrivateForwardTab(sNumTabs);
|
||||||
|
@ -1415,7 +1415,7 @@ bool AdaptDispatch::ForwardTab(const SHORT sNumTabs)
|
||||||
//Arguments:
|
//Arguments:
|
||||||
// - sNumTabs - the number of tabs to perform
|
// - sNumTabs - the number of tabs to perform
|
||||||
// Return value:
|
// Return value:
|
||||||
// True if handled successfully. False othewise.
|
// True if handled successfully. False otherwise.
|
||||||
bool AdaptDispatch::BackwardsTab(const SHORT sNumTabs)
|
bool AdaptDispatch::BackwardsTab(const SHORT sNumTabs)
|
||||||
{
|
{
|
||||||
return !!_conApi->PrivateBackwardsTab(sNumTabs);
|
return !!_conApi->PrivateBackwardsTab(sNumTabs);
|
||||||
|
@ -1428,7 +1428,7 @@ bool AdaptDispatch::BackwardsTab(const SHORT sNumTabs)
|
||||||
//Arguments:
|
//Arguments:
|
||||||
// - sClearType - Whether to clear the current column, or all columns, defined in DispatchTypes::TabClearType
|
// - sClearType - Whether to clear the current column, or all columns, defined in DispatchTypes::TabClearType
|
||||||
// Return value:
|
// Return value:
|
||||||
// True if handled successfully. False othewise.
|
// True if handled successfully. False otherwise.
|
||||||
bool AdaptDispatch::TabClear(const SHORT sClearType)
|
bool AdaptDispatch::TabClear(const SHORT sClearType)
|
||||||
{
|
{
|
||||||
bool fSuccess = false;
|
bool fSuccess = false;
|
||||||
|
@ -1453,7 +1453,7 @@ bool AdaptDispatch::TabClear(const SHORT sClearType)
|
||||||
//Arguments:
|
//Arguments:
|
||||||
// - wchCharset - The character indicating the charset we should switch to.
|
// - wchCharset - The character indicating the charset we should switch to.
|
||||||
// Return value:
|
// Return value:
|
||||||
// True if handled successfully. False othewise.
|
// True if handled successfully. False otherwise.
|
||||||
bool AdaptDispatch::DesignateCharset(const wchar_t wchCharset)
|
bool AdaptDispatch::DesignateCharset(const wchar_t wchCharset)
|
||||||
{
|
{
|
||||||
return _TermOutput.DesignateCharset(wchCharset);
|
return _TermOutput.DesignateCharset(wchCharset);
|
||||||
|
@ -1489,7 +1489,7 @@ bool AdaptDispatch::DesignateCharset(const wchar_t wchCharset)
|
||||||
//Arguments:
|
//Arguments:
|
||||||
// <none>
|
// <none>
|
||||||
// Return value:
|
// Return value:
|
||||||
// True if handled successfully. False othewise.
|
// True if handled successfully. False otherwise.
|
||||||
bool AdaptDispatch::SoftReset()
|
bool AdaptDispatch::SoftReset()
|
||||||
{
|
{
|
||||||
bool fSuccess = CursorVisibility(true); // Cursor enabled.
|
bool fSuccess = CursorVisibility(true); // Cursor enabled.
|
||||||
|
@ -1542,7 +1542,7 @@ bool AdaptDispatch::SoftReset()
|
||||||
//Arguments:
|
//Arguments:
|
||||||
// <none>
|
// <none>
|
||||||
// Return value:
|
// Return value:
|
||||||
// True if handled successfully. False othewise.
|
// True if handled successfully. False otherwise.
|
||||||
bool AdaptDispatch::HardReset()
|
bool AdaptDispatch::HardReset()
|
||||||
{
|
{
|
||||||
// Clears the screen - Needs to be done in two operations.
|
// Clears the screen - Needs to be done in two operations.
|
||||||
|
@ -1581,7 +1581,7 @@ bool AdaptDispatch::HardReset()
|
||||||
//Arguments:
|
//Arguments:
|
||||||
// <none>
|
// <none>
|
||||||
// Return value:
|
// Return value:
|
||||||
// True if handled successfully. False othewise.
|
// True if handled successfully. False otherwise.
|
||||||
bool AdaptDispatch::_EraseScrollback()
|
bool AdaptDispatch::_EraseScrollback()
|
||||||
{
|
{
|
||||||
CONSOLE_SCREEN_BUFFER_INFOEX csbiex = { 0 };
|
CONSOLE_SCREEN_BUFFER_INFOEX csbiex = { 0 };
|
||||||
|
@ -1667,7 +1667,7 @@ bool AdaptDispatch::_EraseScrollback()
|
||||||
//Arguments:
|
//Arguments:
|
||||||
// <none>
|
// <none>
|
||||||
// Return value:
|
// Return value:
|
||||||
// True if handled successfully. False othewise.
|
// True if handled successfully. False otherwise.
|
||||||
bool AdaptDispatch::_EraseAll()
|
bool AdaptDispatch::_EraseAll()
|
||||||
{
|
{
|
||||||
return !!_conApi->PrivateEraseAll();
|
return !!_conApi->PrivateEraseAll();
|
||||||
|
@ -1678,7 +1678,7 @@ bool AdaptDispatch::_EraseAll()
|
||||||
//Arguments:
|
//Arguments:
|
||||||
// - fEnabled - true to enable, false to disable.
|
// - fEnabled - true to enable, false to disable.
|
||||||
// Return value:
|
// Return value:
|
||||||
// True if handled successfully. False othewise.
|
// True if handled successfully. False otherwise.
|
||||||
bool AdaptDispatch::EnableVT200MouseMode(const bool fEnabled)
|
bool AdaptDispatch::EnableVT200MouseMode(const bool fEnabled)
|
||||||
{
|
{
|
||||||
return !!_conApi->PrivateEnableVT200MouseMode(fEnabled);
|
return !!_conApi->PrivateEnableVT200MouseMode(fEnabled);
|
||||||
|
@ -1690,7 +1690,7 @@ bool AdaptDispatch::EnableVT200MouseMode(const bool fEnabled)
|
||||||
//Arguments:
|
//Arguments:
|
||||||
// - fEnabled - true to enable, false to disable.
|
// - fEnabled - true to enable, false to disable.
|
||||||
// Return value:
|
// Return value:
|
||||||
// True if handled successfully. False othewise.
|
// True if handled successfully. False otherwise.
|
||||||
bool AdaptDispatch::EnableUTF8ExtendedMouseMode(const bool fEnabled)
|
bool AdaptDispatch::EnableUTF8ExtendedMouseMode(const bool fEnabled)
|
||||||
{
|
{
|
||||||
return !!_conApi->PrivateEnableUTF8ExtendedMouseMode(fEnabled);
|
return !!_conApi->PrivateEnableUTF8ExtendedMouseMode(fEnabled);
|
||||||
|
@ -1702,7 +1702,7 @@ bool AdaptDispatch::EnableUTF8ExtendedMouseMode(const bool fEnabled)
|
||||||
//Arguments:
|
//Arguments:
|
||||||
// - fEnabled - true to enable, false to disable.
|
// - fEnabled - true to enable, false to disable.
|
||||||
// Return value:
|
// Return value:
|
||||||
// True if handled successfully. False othewise.
|
// True if handled successfully. False otherwise.
|
||||||
bool AdaptDispatch::EnableSGRExtendedMouseMode(const bool fEnabled)
|
bool AdaptDispatch::EnableSGRExtendedMouseMode(const bool fEnabled)
|
||||||
{
|
{
|
||||||
return !!_conApi->PrivateEnableSGRExtendedMouseMode(fEnabled);
|
return !!_conApi->PrivateEnableSGRExtendedMouseMode(fEnabled);
|
||||||
|
@ -1713,7 +1713,7 @@ bool AdaptDispatch::EnableSGRExtendedMouseMode(const bool fEnabled)
|
||||||
//Arguments:
|
//Arguments:
|
||||||
// - fEnabled - true to enable, false to disable.
|
// - fEnabled - true to enable, false to disable.
|
||||||
// Return value:
|
// Return value:
|
||||||
// True if handled successfully. False othewise.
|
// True if handled successfully. False otherwise.
|
||||||
bool AdaptDispatch::EnableButtonEventMouseMode(const bool fEnabled)
|
bool AdaptDispatch::EnableButtonEventMouseMode(const bool fEnabled)
|
||||||
{
|
{
|
||||||
return !!_conApi->PrivateEnableButtonEventMouseMode(fEnabled);
|
return !!_conApi->PrivateEnableButtonEventMouseMode(fEnabled);
|
||||||
|
@ -1725,7 +1725,7 @@ bool AdaptDispatch::EnableButtonEventMouseMode(const bool fEnabled)
|
||||||
//Arguments:
|
//Arguments:
|
||||||
// - fEnabled - true to enable, false to disable.
|
// - fEnabled - true to enable, false to disable.
|
||||||
// Return value:
|
// Return value:
|
||||||
// True if handled successfully. False othewise.
|
// True if handled successfully. False otherwise.
|
||||||
bool AdaptDispatch::EnableAnyEventMouseMode(const bool fEnabled)
|
bool AdaptDispatch::EnableAnyEventMouseMode(const bool fEnabled)
|
||||||
{
|
{
|
||||||
return !!_conApi->PrivateEnableAnyEventMouseMode(fEnabled);
|
return !!_conApi->PrivateEnableAnyEventMouseMode(fEnabled);
|
||||||
|
@ -1737,7 +1737,7 @@ bool AdaptDispatch::EnableAnyEventMouseMode(const bool fEnabled)
|
||||||
//Arguments:
|
//Arguments:
|
||||||
// - fEnabled - true to enable, false to disable.
|
// - fEnabled - true to enable, false to disable.
|
||||||
// Return value:
|
// Return value:
|
||||||
// True if handled successfully. False othewise.
|
// True if handled successfully. False otherwise.
|
||||||
bool AdaptDispatch::EnableAlternateScroll(const bool fEnabled)
|
bool AdaptDispatch::EnableAlternateScroll(const bool fEnabled)
|
||||||
{
|
{
|
||||||
return !!_conApi->PrivateEnableAlternateScroll(fEnabled);
|
return !!_conApi->PrivateEnableAlternateScroll(fEnabled);
|
||||||
|
@ -1749,7 +1749,7 @@ bool AdaptDispatch::EnableAlternateScroll(const bool fEnabled)
|
||||||
//Arguments:
|
//Arguments:
|
||||||
// - cursorStyle - The unix-like cursor style to apply to the cursor
|
// - cursorStyle - The unix-like cursor style to apply to the cursor
|
||||||
// Return value:
|
// Return value:
|
||||||
// True if handled successfully. False othewise.
|
// True if handled successfully. False otherwise.
|
||||||
bool AdaptDispatch::SetCursorStyle(const DispatchTypes::CursorStyle cursorStyle)
|
bool AdaptDispatch::SetCursorStyle(const DispatchTypes::CursorStyle cursorStyle)
|
||||||
{
|
{
|
||||||
bool isPty = false;
|
bool isPty = false;
|
||||||
|
@ -1808,7 +1808,7 @@ bool AdaptDispatch::SetCursorStyle(const DispatchTypes::CursorStyle cursorStyle)
|
||||||
// - tableIndex: The VT color table index
|
// - tableIndex: The VT color table index
|
||||||
// - dwColor: The new RGB color value to use.
|
// - dwColor: The new RGB color value to use.
|
||||||
// Return Value:
|
// Return Value:
|
||||||
// True if handled successfully. False othewise.
|
// True if handled successfully. False otherwise.
|
||||||
bool AdaptDispatch::SetCursorColor(const COLORREF cursorColor)
|
bool AdaptDispatch::SetCursorColor(const COLORREF cursorColor)
|
||||||
{
|
{
|
||||||
bool isPty = false;
|
bool isPty = false;
|
||||||
|
@ -1827,9 +1827,8 @@ bool AdaptDispatch::SetCursorColor(const COLORREF cursorColor)
|
||||||
// - tableIndex: The VT color table index
|
// - tableIndex: The VT color table index
|
||||||
// - dwColor: The new RGB color value to use.
|
// - dwColor: The new RGB color value to use.
|
||||||
// Return Value:
|
// Return Value:
|
||||||
// True if handled successfully. False othewise.
|
// True if handled successfully. False otherwise.
|
||||||
bool AdaptDispatch::SetColorTableEntry(const size_t tableIndex,
|
bool AdaptDispatch::SetColorTableEntry(const size_t tableIndex, const DWORD dwColor)
|
||||||
const DWORD dwColor)
|
|
||||||
{
|
{
|
||||||
|
|
||||||
bool fSuccess = tableIndex < 256;
|
bool fSuccess = tableIndex < 256;
|
||||||
|
@ -1853,6 +1852,56 @@ bool AdaptDispatch::SetColorTableEntry(const size_t tableIndex,
|
||||||
return fSuccess;
|
return fSuccess;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Method Description:
|
||||||
|
// - Sets the default foreground color to a new value
|
||||||
|
// Arguments:
|
||||||
|
// - dwColor: The new RGB color value to use, as a COLORREF, format 0x00BBGGRR.
|
||||||
|
// Return Value:
|
||||||
|
// True if handled successfully. False otherwise.
|
||||||
|
bool Microsoft::Console::VirtualTerminal::AdaptDispatch::SetDefaultForeground(const DWORD dwColor)
|
||||||
|
{
|
||||||
|
bool fSuccess = true;
|
||||||
|
fSuccess = !!_conApi->PrivateSetDefaultForeground(dwColor);
|
||||||
|
|
||||||
|
// If we're a conpty, always return false, so that we send the updated color
|
||||||
|
// value to the terminal. Still handle the sequence so apps that use
|
||||||
|
// the API or VT to query the values of the color table still read the
|
||||||
|
// correct color.
|
||||||
|
bool isPty = false;
|
||||||
|
_conApi->IsConsolePty(&isPty);
|
||||||
|
if (isPty)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return fSuccess;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Method Description:
|
||||||
|
// - Sets the default background color to a new value
|
||||||
|
// Arguments:
|
||||||
|
// - dwColor: The new RGB color value to use, as a COLORREF, format 0x00BBGGRR.
|
||||||
|
// Return Value:
|
||||||
|
// True if handled successfully. False otherwise.
|
||||||
|
bool Microsoft::Console::VirtualTerminal::AdaptDispatch::SetDefaultBackground(const DWORD dwColor)
|
||||||
|
{
|
||||||
|
bool fSuccess = true;
|
||||||
|
fSuccess = !!_conApi->PrivateSetDefaultBackground(dwColor);
|
||||||
|
|
||||||
|
// If we're a conpty, always return false, so that we send the updated color
|
||||||
|
// value to the terminal. Still handle the sequence so apps that use
|
||||||
|
// the API or VT to query the values of the color table still read the
|
||||||
|
// correct color.
|
||||||
|
bool isPty = false;
|
||||||
|
_conApi->IsConsolePty(&isPty);
|
||||||
|
if (isPty)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return fSuccess;
|
||||||
|
}
|
||||||
|
|
||||||
//Routine Description:
|
//Routine Description:
|
||||||
// Window Manipulation - Performs a variety of actions relating to the window,
|
// Window Manipulation - Performs a variety of actions relating to the window,
|
||||||
// such as moving the window position, resizing the window, querying
|
// such as moving the window position, resizing the window, querying
|
||||||
|
@ -1864,7 +1913,7 @@ bool AdaptDispatch::SetColorTableEntry(const size_t tableIndex,
|
||||||
// - rgusParams - Additional parameters to pass to the function
|
// - rgusParams - Additional parameters to pass to the function
|
||||||
// - cParams - size of rgusParams
|
// - cParams - size of rgusParams
|
||||||
// Return value:
|
// Return value:
|
||||||
// True if handled successfully. False othewise.
|
// True if handled successfully. False otherwise.
|
||||||
bool AdaptDispatch::WindowManipulation(const DispatchTypes::WindowManipulationType uiFunction,
|
bool AdaptDispatch::WindowManipulation(const DispatchTypes::WindowManipulationType uiFunction,
|
||||||
_In_reads_(cParams) const unsigned short* const rgusParams,
|
_In_reads_(cParams) const unsigned short* const rgusParams,
|
||||||
const size_t cParams)
|
const size_t cParams)
|
||||||
|
|
|
@ -33,74 +33,77 @@ namespace Microsoft::Console::VirtualTerminal
|
||||||
AdaptDispatch(ConGetSet* const pConApi,
|
AdaptDispatch(ConGetSet* const pConApi,
|
||||||
AdaptDefaults* const pDefaults);
|
AdaptDefaults* const pDefaults);
|
||||||
|
|
||||||
virtual void Execute(const wchar_t wchControl)
|
void Execute(const wchar_t wchControl) override
|
||||||
{
|
{
|
||||||
_pDefaults->Execute(wchControl);
|
_pDefaults->Execute(wchControl);
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void PrintString(const wchar_t* const rgwch, const size_t cch);
|
void PrintString(const wchar_t* const rgwch, const size_t cch) override;
|
||||||
virtual void Print(const wchar_t wchPrintable);
|
void Print(const wchar_t wchPrintable) override;
|
||||||
|
|
||||||
virtual bool CursorUp(_In_ unsigned int const uiDistance); // CUU
|
bool CursorUp(_In_ unsigned int const uiDistance) override; // CUU
|
||||||
virtual bool CursorDown(_In_ unsigned int const uiDistance); // CUD
|
bool CursorDown(_In_ unsigned int const uiDistance) override; // CUD
|
||||||
virtual bool CursorForward(_In_ unsigned int const uiDistance); // CUF
|
bool CursorForward(_In_ unsigned int const uiDistance) override; // CUF
|
||||||
virtual bool CursorBackward(_In_ unsigned int const uiDistance); // CUB
|
bool CursorBackward(_In_ unsigned int const uiDistance) override; // CUB
|
||||||
virtual bool CursorNextLine(_In_ unsigned int const uiDistance); // CNL
|
bool CursorNextLine(_In_ unsigned int const uiDistance) override; // CNL
|
||||||
virtual bool CursorPrevLine(_In_ unsigned int const uiDistance); // CPL
|
bool CursorPrevLine(_In_ unsigned int const uiDistance) override; // CPL
|
||||||
virtual bool CursorHorizontalPositionAbsolute(_In_ unsigned int const uiColumn); // CHA
|
bool CursorHorizontalPositionAbsolute(_In_ unsigned int const uiColumn) override; // CHA
|
||||||
virtual bool VerticalLinePositionAbsolute(_In_ unsigned int const uiLine); // VPA
|
bool VerticalLinePositionAbsolute(_In_ unsigned int const uiLine) override; // VPA
|
||||||
virtual bool CursorPosition(_In_ unsigned int const uiLine, _In_ unsigned int const uiColumn); // CUP
|
bool CursorPosition(_In_ unsigned int const uiLine, _In_ unsigned int const uiColumn) override; // CUP
|
||||||
virtual bool CursorSavePosition(); // DECSC
|
bool CursorSavePosition() override; // DECSC
|
||||||
virtual bool CursorRestorePosition(); // DECRC
|
bool CursorRestorePosition() override; // DECRC
|
||||||
virtual bool CursorVisibility(const bool fIsVisible); // DECTCEM
|
bool CursorVisibility(const bool fIsVisible) override; // DECTCEM
|
||||||
virtual bool EraseInDisplay(const DispatchTypes::EraseType eraseType); // ED
|
bool EraseInDisplay(const DispatchTypes::EraseType eraseType) override; // ED
|
||||||
virtual bool EraseInLine(const DispatchTypes::EraseType eraseType); // EL
|
bool EraseInLine(const DispatchTypes::EraseType eraseType) override; // EL
|
||||||
virtual bool EraseCharacters(_In_ unsigned int const uiNumChars); // ECH
|
bool EraseCharacters(_In_ unsigned int const uiNumChars) override; // ECH
|
||||||
virtual bool InsertCharacter(_In_ unsigned int const uiCount); // ICH
|
bool InsertCharacter(_In_ unsigned int const uiCount) override; // ICH
|
||||||
virtual bool DeleteCharacter(_In_ unsigned int const uiCount); // DCH
|
bool DeleteCharacter(_In_ unsigned int const uiCount) override; // DCH
|
||||||
virtual bool SetGraphicsRendition(_In_reads_(cOptions) const DispatchTypes::GraphicsOptions* const rgOptions,
|
bool SetGraphicsRendition(_In_reads_(cOptions) const DispatchTypes::GraphicsOptions* const rgOptions,
|
||||||
const size_t cOptions); // SGR
|
const size_t cOptions) override; // SGR
|
||||||
virtual bool DeviceStatusReport(const DispatchTypes::AnsiStatusType statusType); // DSR
|
bool DeviceStatusReport(const DispatchTypes::AnsiStatusType statusType) override; // DSR
|
||||||
virtual bool DeviceAttributes(); // DA
|
bool DeviceAttributes() override; // DA
|
||||||
virtual bool ScrollUp(_In_ unsigned int const uiDistance); // SU
|
bool ScrollUp(_In_ unsigned int const uiDistance) override; // SU
|
||||||
virtual bool ScrollDown(_In_ unsigned int const uiDistance); // SD
|
bool ScrollDown(_In_ unsigned int const uiDistance) override; // SD
|
||||||
virtual bool InsertLine(_In_ unsigned int const uiDistance); // IL
|
bool InsertLine(_In_ unsigned int const uiDistance) override; // IL
|
||||||
virtual bool DeleteLine(_In_ unsigned int const uiDistance); // DL
|
bool DeleteLine(_In_ unsigned int const uiDistance) override; // DL
|
||||||
virtual bool SetColumns(_In_ unsigned int const uiColumns); // DECSCPP, DECCOLM
|
bool SetColumns(_In_ unsigned int const uiColumns) override; // DECSCPP, DECCOLM
|
||||||
virtual bool SetPrivateModes(_In_reads_(cParams) const DispatchTypes::PrivateModeParams* const rParams,
|
bool SetPrivateModes(_In_reads_(cParams) const DispatchTypes::PrivateModeParams* const rParams,
|
||||||
const size_t cParams); // DECSET
|
const size_t cParams) override; // DECSET
|
||||||
virtual bool ResetPrivateModes(_In_reads_(cParams) const DispatchTypes::PrivateModeParams* const rParams,
|
bool ResetPrivateModes(_In_reads_(cParams) const DispatchTypes::PrivateModeParams* const rParams,
|
||||||
const size_t cParams); // DECRST
|
const size_t cParams) override; // DECRST
|
||||||
virtual bool SetCursorKeysMode(const bool fApplicationMode); // DECCKM
|
bool SetCursorKeysMode(const bool fApplicationMode) override; // DECCKM
|
||||||
virtual bool SetKeypadMode(const bool fApplicationMode); // DECKPAM, DECKPNM
|
bool SetKeypadMode(const bool fApplicationMode) override; // DECKPAM, DECKPNM
|
||||||
virtual bool EnableCursorBlinking(const bool bEnable); // ATT610
|
bool EnableCursorBlinking(const bool bEnable) override; // ATT610
|
||||||
virtual bool SetTopBottomScrollingMargins(const SHORT sTopMargin,
|
bool SetTopBottomScrollingMargins(const SHORT sTopMargin,
|
||||||
const SHORT sBottomMargin); // DECSTBM
|
const SHORT sBottomMargin) override; // DECSTBM
|
||||||
virtual bool ReverseLineFeed(); // RI
|
bool ReverseLineFeed() override; // RI
|
||||||
virtual bool SetWindowTitle(const std::wstring_view title) override; // OscWindowTitle
|
bool SetWindowTitle(const std::wstring_view title) override; // OscWindowTitle
|
||||||
virtual bool UseAlternateScreenBuffer(); // ASBSET
|
bool UseAlternateScreenBuffer() override; // ASBSET
|
||||||
virtual bool UseMainScreenBuffer(); // ASBRST
|
bool UseMainScreenBuffer() override; // ASBRST
|
||||||
virtual bool HorizontalTabSet(); // HTS
|
bool HorizontalTabSet() override; // HTS
|
||||||
virtual bool ForwardTab(const SHORT sNumTabs); // CHT
|
bool ForwardTab(const SHORT sNumTabs) override; // CHT
|
||||||
virtual bool BackwardsTab(const SHORT sNumTabs); // CBT
|
bool BackwardsTab(const SHORT sNumTabs) override; // CBT
|
||||||
virtual bool TabClear(const SHORT sClearType); // TBC
|
bool TabClear(const SHORT sClearType) override; // TBC
|
||||||
virtual bool DesignateCharset(const wchar_t wchCharset); // DesignateCharset
|
bool DesignateCharset(const wchar_t wchCharset) override; // DesignateCharset
|
||||||
virtual bool SoftReset(); // DECSTR
|
bool SoftReset() override; // DECSTR
|
||||||
virtual bool HardReset(); // RIS
|
bool HardReset() override; // RIS
|
||||||
virtual bool EnableVT200MouseMode(const bool fEnabled); // ?1000
|
bool EnableVT200MouseMode(const bool fEnabled) override; // ?1000
|
||||||
virtual bool EnableUTF8ExtendedMouseMode(const bool fEnabled); // ?1005
|
bool EnableUTF8ExtendedMouseMode(const bool fEnabled) override; // ?1005
|
||||||
virtual bool EnableSGRExtendedMouseMode(const bool fEnabled); // ?1006
|
bool EnableSGRExtendedMouseMode(const bool fEnabled) override; // ?1006
|
||||||
virtual bool EnableButtonEventMouseMode(const bool fEnabled); // ?1002
|
bool EnableButtonEventMouseMode(const bool fEnabled) override; // ?1002
|
||||||
virtual bool EnableAnyEventMouseMode(const bool fEnabled); // ?1003
|
bool EnableAnyEventMouseMode(const bool fEnabled) override; // ?1003
|
||||||
virtual bool EnableAlternateScroll(const bool fEnabled); // ?1007
|
bool EnableAlternateScroll(const bool fEnabled) override; // ?1007
|
||||||
virtual bool SetCursorStyle(const DispatchTypes::CursorStyle cursorStyle); // DECSCUSR
|
bool SetCursorStyle(const DispatchTypes::CursorStyle cursorStyle) override; // DECSCUSR
|
||||||
virtual bool SetCursorColor(const COLORREF cursorColor);
|
bool SetCursorColor(const COLORREF cursorColor) override;
|
||||||
|
|
||||||
virtual bool SetColorTableEntry(const size_t tableIndex,
|
bool SetColorTableEntry(const size_t tableIndex,
|
||||||
const DWORD dwColor); // OscColorTable
|
const DWORD dwColor) override; // OscColorTable
|
||||||
virtual bool WindowManipulation(const DispatchTypes::WindowManipulationType uiFunction,
|
bool SetDefaultForeground(const DWORD dwColor) override; // OSCDefaultForeground
|
||||||
_In_reads_(cParams) const unsigned short* const rgusParams,
|
bool SetDefaultBackground(const DWORD dwColor) override; // OSCDefaultBackground
|
||||||
const size_t cParams); // DTTERM_WindowManipulation
|
|
||||||
|
bool WindowManipulation(const DispatchTypes::WindowManipulationType uiFunction,
|
||||||
|
_In_reads_(cParams) const unsigned short* const rgusParams,
|
||||||
|
const size_t cParams) override; // DTTERM_WindowManipulation
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
|
|
@ -107,6 +107,8 @@ namespace Microsoft::Console::VirtualTerminal
|
||||||
virtual BOOL MoveToBottom() const = 0;
|
virtual BOOL MoveToBottom() const = 0;
|
||||||
|
|
||||||
virtual BOOL PrivateSetColorTableEntry(const short index, const COLORREF value) const = 0;
|
virtual BOOL PrivateSetColorTableEntry(const short index, const COLORREF value) const = 0;
|
||||||
|
virtual BOOL PrivateSetDefaultForeground(const COLORREF value) const = 0;
|
||||||
|
virtual BOOL PrivateSetDefaultBackground(const COLORREF value) const = 0;
|
||||||
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,77 +20,79 @@ namespace Microsoft::Console::VirtualTerminal
|
||||||
class Microsoft::Console::VirtualTerminal::TermDispatch : public Microsoft::Console::VirtualTerminal::ITermDispatch
|
class Microsoft::Console::VirtualTerminal::TermDispatch : public Microsoft::Console::VirtualTerminal::ITermDispatch
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
virtual void Execute(const wchar_t wchControl) = 0;
|
void Execute(const wchar_t wchControl) override = 0;
|
||||||
virtual void Print(const wchar_t wchPrintable) = 0;
|
void Print(const wchar_t wchPrintable) override = 0;
|
||||||
virtual void PrintString(const wchar_t* const rgwch, const size_t cch) = 0;
|
void PrintString(const wchar_t* const rgwch, const size_t cch) override = 0;
|
||||||
|
|
||||||
virtual bool CursorUp(const unsigned int /*uiDistance*/) { return false; }; // CUU
|
bool CursorUp(const unsigned int /*uiDistance*/) override { return false; } // CUU
|
||||||
virtual bool CursorDown(const unsigned int /*uiDistance*/) { return false; } // CUD
|
bool CursorDown(const unsigned int /*uiDistance*/) override { return false; } // CUD
|
||||||
virtual bool CursorForward(const unsigned int /*uiDistance*/) { return false; } // CUF
|
bool CursorForward(const unsigned int /*uiDistance*/) override { return false; } // CUF
|
||||||
virtual bool CursorBackward(const unsigned int /*uiDistance*/) { return false; } // CUB
|
bool CursorBackward(const unsigned int /*uiDistance*/) override { return false; } // CUB
|
||||||
virtual bool CursorNextLine(const unsigned int /*uiDistance*/) { return false; } // CNL
|
bool CursorNextLine(const unsigned int /*uiDistance*/) override { return false; } // CNL
|
||||||
virtual bool CursorPrevLine(const unsigned int /*uiDistance*/) { return false; } // CPL
|
bool CursorPrevLine(const unsigned int /*uiDistance*/) override { return false; } // CPL
|
||||||
virtual bool CursorHorizontalPositionAbsolute(const unsigned int /*uiColumn*/) { return false; } // CHA
|
bool CursorHorizontalPositionAbsolute(const unsigned int /*uiColumn*/) override { return false; } // CHA
|
||||||
virtual bool VerticalLinePositionAbsolute(const unsigned int /*uiLine*/) { return false; } // VPA
|
bool VerticalLinePositionAbsolute(const unsigned int /*uiLine*/) override { return false; } // VPA
|
||||||
virtual bool CursorPosition(const unsigned int /*uiLine*/, const unsigned int /*uiColumn*/) { return false; } // CUP
|
bool CursorPosition(const unsigned int /*uiLine*/, const unsigned int /*uiColumn*/) override { return false; } // CUP
|
||||||
virtual bool CursorSavePosition() { return false; } // DECSC
|
bool CursorSavePosition() override { return false; } // DECSC
|
||||||
virtual bool CursorRestorePosition() { return false; } // DECRC
|
bool CursorRestorePosition() override { return false; } // DECRC
|
||||||
virtual bool CursorVisibility(const bool /*fIsVisible*/) { return false; } // DECTCEM
|
bool CursorVisibility(const bool /*fIsVisible*/) override { return false; } // DECTCEM
|
||||||
virtual bool InsertCharacter(const unsigned int /*uiCount*/) { return false; } // ICH
|
bool InsertCharacter(const unsigned int /*uiCount*/) override { return false; } // ICH
|
||||||
virtual bool DeleteCharacter(const unsigned int /*uiCount*/) { return false; } // DCH
|
bool DeleteCharacter(const unsigned int /*uiCount*/) override { return false; } // DCH
|
||||||
virtual bool ScrollUp(const unsigned int /*uiDistance*/) { return false; } // SU
|
bool ScrollUp(const unsigned int /*uiDistance*/) override { return false; } // SU
|
||||||
virtual bool ScrollDown(const unsigned int /*uiDistance*/) { return false; } // SD
|
bool ScrollDown(const unsigned int /*uiDistance*/) override { return false; } // SD
|
||||||
virtual bool InsertLine(const unsigned int /*uiDistance*/) { return false; } // IL
|
bool InsertLine(const unsigned int /*uiDistance*/) override { return false; } // IL
|
||||||
virtual bool DeleteLine(const unsigned int /*uiDistance*/) { return false; } // DL
|
bool DeleteLine(const unsigned int /*uiDistance*/) override { return false; } // DL
|
||||||
virtual bool SetColumns(const unsigned int /*uiColumns*/) { return false; } // DECSCPP, DECCOLM
|
bool SetColumns(const unsigned int /*uiColumns*/) override { return false; } // DECSCPP, DECCOLM
|
||||||
virtual bool SetCursorKeysMode(const bool /*fApplicationMode*/) { return false; } // DECCKM
|
bool SetCursorKeysMode(const bool /*fApplicationMode*/) override { return false; } // DECCKM
|
||||||
virtual bool SetKeypadMode(const bool /*fApplicationMode*/) { return false; } // DECKPAM, DECKPNM
|
bool SetKeypadMode(const bool /*fApplicationMode*/) override { return false; } // DECKPAM, DECKPNM
|
||||||
virtual bool EnableCursorBlinking(const bool /*fEnable*/) { return false; } // ATT610
|
bool EnableCursorBlinking(const bool /*fEnable*/) override { return false; } // ATT610
|
||||||
virtual bool SetTopBottomScrollingMargins(const SHORT /*sTopMargin*/, const SHORT /*sBottomMargin*/) { return false; } // DECSTBM
|
bool SetTopBottomScrollingMargins(const SHORT /*sTopMargin*/, const SHORT /*sBottomMargin*/) override { return false; } // DECSTBM
|
||||||
virtual bool ReverseLineFeed() { return false; } // RI
|
bool ReverseLineFeed() override { return false; } // RI
|
||||||
virtual bool SetWindowTitle(std::wstring_view /*title*/) { return false; } // OscWindowTitle
|
bool SetWindowTitle(std::wstring_view /*title*/) override { return false; } // OscWindowTitle
|
||||||
virtual bool UseAlternateScreenBuffer() { return false; } // ASBSET
|
bool UseAlternateScreenBuffer() override { return false; } // ASBSET
|
||||||
virtual bool UseMainScreenBuffer() { return false; } // ASBRST
|
bool UseMainScreenBuffer() override { return false; } // ASBRST
|
||||||
virtual bool HorizontalTabSet() { return false; } // HTS
|
bool HorizontalTabSet() override { return false; } // HTS
|
||||||
virtual bool ForwardTab(const SHORT /*sNumTabs*/) { return false; } // CHT
|
bool ForwardTab(const SHORT /*sNumTabs*/) override { return false; } // CHT
|
||||||
virtual bool BackwardsTab(const SHORT /*sNumTabs*/) { return false; } // CBT
|
bool BackwardsTab(const SHORT /*sNumTabs*/) override { return false; } // CBT
|
||||||
virtual bool TabClear(const SHORT /*sClearType*/) { return false; } // TBC
|
bool TabClear(const SHORT /*sClearType*/) override { return false; } // TBC
|
||||||
virtual bool EnableVT200MouseMode(const bool /*fEnabled*/) { return false; } // ?1000
|
bool EnableVT200MouseMode(const bool /*fEnabled*/) override { return false; } // ?1000
|
||||||
virtual bool EnableUTF8ExtendedMouseMode(const bool /*fEnabled*/) { return false; } // ?1005
|
bool EnableUTF8ExtendedMouseMode(const bool /*fEnabled*/) override { return false; } // ?1005
|
||||||
virtual bool EnableSGRExtendedMouseMode(const bool /*fEnabled*/) { return false; } // ?1006
|
bool EnableSGRExtendedMouseMode(const bool /*fEnabled*/) override { return false; } // ?1006
|
||||||
virtual bool EnableButtonEventMouseMode(const bool /*fEnabled*/) { return false; } // ?1002
|
bool EnableButtonEventMouseMode(const bool /*fEnabled*/)override { return false; } // ?1002
|
||||||
virtual bool EnableAnyEventMouseMode(const bool /*fEnabled*/) { return false; } // ?1003
|
bool EnableAnyEventMouseMode(const bool /*fEnabled*/) override { return false; } // ?1003
|
||||||
virtual bool EnableAlternateScroll(const bool /*fEnabled*/) { return false; } // ?1007
|
bool EnableAlternateScroll(const bool /*fEnabled*/) override { return false; } // ?1007
|
||||||
virtual bool SetColorTableEntry(const size_t /*tableIndex*/, const DWORD /*dwColor*/) { return false; } // OSCColorTable
|
bool SetColorTableEntry(const size_t /*tableIndex*/, const DWORD /*dwColor*/) override { return false; } // OSCColorTable
|
||||||
|
bool SetDefaultForeground(const DWORD /*dwColor*/) override { return false; } // OSCDefaultForeground
|
||||||
|
bool SetDefaultBackground(const DWORD /*dwColor*/) override { return false; } // OSCDefaultBackground
|
||||||
|
|
||||||
virtual bool EraseInDisplay(const DispatchTypes::EraseType /* eraseType*/) { return false; } // ED
|
bool EraseInDisplay(const DispatchTypes::EraseType /* eraseType*/) override { return false; } // ED
|
||||||
virtual bool EraseInLine(const DispatchTypes::EraseType /* eraseType*/) { return false; } // EL
|
bool EraseInLine(const DispatchTypes::EraseType /* eraseType*/) override { return false; } // EL
|
||||||
virtual bool EraseCharacters(const unsigned int /*uiNumChars*/){ return false; } // ECH
|
bool EraseCharacters(const unsigned int /*uiNumChars*/) override { return false; } // ECH
|
||||||
|
|
||||||
virtual bool SetGraphicsRendition(_In_reads_(_Param_(2)) const DispatchTypes::GraphicsOptions* const /*rgOptions*/,
|
bool SetGraphicsRendition(_In_reads_(_Param_(2)) const DispatchTypes::GraphicsOptions* const /*rgOptions*/,
|
||||||
const size_t /*cOptions*/) { return false; } // SGR
|
const size_t /*cOptions*/) override { return false; } // SGR
|
||||||
|
|
||||||
virtual bool SetPrivateModes(_In_reads_(_Param_(2)) const DispatchTypes::PrivateModeParams* const /*rgParams*/,
|
bool SetPrivateModes(_In_reads_(_Param_(2)) const DispatchTypes::PrivateModeParams* const /*rgParams*/,
|
||||||
const size_t /*cParams*/) { return false; } // DECSET
|
const size_t /*cParams*/) override { return false; } // DECSET
|
||||||
|
|
||||||
virtual bool ResetPrivateModes(_In_reads_(_Param_(2)) const DispatchTypes::PrivateModeParams* const /*rgParams*/,
|
bool ResetPrivateModes(_In_reads_(_Param_(2)) const DispatchTypes::PrivateModeParams* const /*rgParams*/,
|
||||||
const size_t /*cParams*/) { return false; } // DECRST
|
const size_t /*cParams*/) override { return false; } // DECRST
|
||||||
|
|
||||||
virtual bool DeviceStatusReport(const DispatchTypes::AnsiStatusType /*statusType*/) { return false; } // DSR
|
bool DeviceStatusReport(const DispatchTypes::AnsiStatusType /*statusType*/) override { return false; } // DSR
|
||||||
virtual bool DeviceAttributes() { return false; } // DA
|
bool DeviceAttributes() override { return false; } // DA
|
||||||
|
|
||||||
virtual bool DesignateCharset(const wchar_t /*wchCharset*/){ return false; } // DesignateCharset
|
bool DesignateCharset(const wchar_t /*wchCharset*/) override { return false; } // DesignateCharset
|
||||||
|
|
||||||
virtual bool SoftReset(){ return false; } // DECSTR
|
bool SoftReset() override { return false; } // DECSTR
|
||||||
virtual bool HardReset(){ return false; } // RIS
|
bool HardReset() override { return false; } // RIS
|
||||||
|
|
||||||
virtual bool SetCursorStyle(const DispatchTypes::CursorStyle /*cursorStyle*/){ return false; } // DECSCUSR
|
|
||||||
virtual bool SetCursorColor(const COLORREF /*Color*/) { return false; } // OSCSetCursorColor, OSCResetCursorColor
|
|
||||||
|
|
||||||
|
bool SetCursorStyle(const DispatchTypes::CursorStyle /*cursorStyle*/) override { return false; } // DECSCUSR
|
||||||
|
bool SetCursorColor(const COLORREF /*Color*/) override { return false; } // OSCSetCursorColor, OSCResetCursorColor
|
||||||
|
|
||||||
// DTTERM_WindowManipulation
|
// DTTERM_WindowManipulation
|
||||||
virtual bool WindowManipulation(const DispatchTypes::WindowManipulationType /*uiFunction*/,
|
bool WindowManipulation(const DispatchTypes::WindowManipulationType /*uiFunction*/,
|
||||||
_In_reads_(_Param_(3)) const unsigned short* const /*rgusParams*/,
|
_In_reads_(_Param_(3)) const unsigned short* const /*rgusParams*/,
|
||||||
const size_t /*cParams*/) { return false; }
|
const size_t /*cParams*/) override { return false; }
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -776,6 +776,28 @@ public:
|
||||||
return _fPrivateSetColorTableEntryResult;
|
return _fPrivateSetColorTableEntryResult;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
BOOL PrivateSetDefaultForeground(const COLORREF value) const noexcept override
|
||||||
|
{
|
||||||
|
Log::Comment(L"PrivateSetDefaultForeground MOCK called...");
|
||||||
|
if (_fPrivateSetDefaultForegroundResult)
|
||||||
|
{
|
||||||
|
VERIFY_ARE_EQUAL(_expectedDefaultForegroundColorValue, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
return _fPrivateSetDefaultForegroundResult;
|
||||||
|
}
|
||||||
|
|
||||||
|
BOOL PrivateSetDefaultBackground(const COLORREF value) const noexcept override
|
||||||
|
{
|
||||||
|
Log::Comment(L"PrivateSetDefaultForeground MOCK called...");
|
||||||
|
if (_fPrivateSetDefaultBackgroundResult)
|
||||||
|
{
|
||||||
|
VERIFY_ARE_EQUAL(_expectedDefaultBackgroundColorValue, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
return _fPrivateSetDefaultBackgroundResult;
|
||||||
|
}
|
||||||
|
|
||||||
void _IncrementCoordPos(_Inout_ COORD* pcoord)
|
void _IncrementCoordPos(_Inout_ COORD* pcoord)
|
||||||
{
|
{
|
||||||
pcoord->X++;
|
pcoord->X++;
|
||||||
|
@ -1378,6 +1400,12 @@ public:
|
||||||
short _expectedColorTableIndex = -1;
|
short _expectedColorTableIndex = -1;
|
||||||
COLORREF _expectedColorValue = INVALID_COLOR;
|
COLORREF _expectedColorValue = INVALID_COLOR;
|
||||||
|
|
||||||
|
bool _fPrivateSetDefaultForegroundResult = false;
|
||||||
|
COLORREF _expectedDefaultForegroundColorValue = INVALID_COLOR;
|
||||||
|
|
||||||
|
bool _fPrivateSetDefaultBackgroundResult = false;
|
||||||
|
COLORREF _expectedDefaultBackgroundColorValue = INVALID_COLOR;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
HANDLE _hCon;
|
HANDLE _hCon;
|
||||||
};
|
};
|
||||||
|
|
|
@ -697,8 +697,10 @@ bool OutputStateMachineEngine::ActionOscDispatch(const wchar_t /*wch*/,
|
||||||
case OscActionCodes::SetColor:
|
case OscActionCodes::SetColor:
|
||||||
fSuccess = _GetOscSetColorTable(pwchOscStringBuffer, cchOscString, &tableIndex, &dwColor);
|
fSuccess = _GetOscSetColorTable(pwchOscStringBuffer, cchOscString, &tableIndex, &dwColor);
|
||||||
break;
|
break;
|
||||||
|
case OscActionCodes::SetForegroundColor:
|
||||||
|
case OscActionCodes::SetBackgroundColor:
|
||||||
case OscActionCodes::SetCursorColor:
|
case OscActionCodes::SetCursorColor:
|
||||||
fSuccess = _GetOscSetCursorColor(pwchOscStringBuffer, cchOscString, &dwColor);
|
fSuccess = _GetOscSetColor(pwchOscStringBuffer, cchOscString, &dwColor);
|
||||||
break;
|
break;
|
||||||
case OscActionCodes::ResetCursorColor:
|
case OscActionCodes::ResetCursorColor:
|
||||||
// the console uses 0xffffffff as an "invalid color" value
|
// the console uses 0xffffffff as an "invalid color" value
|
||||||
|
@ -724,6 +726,14 @@ bool OutputStateMachineEngine::ActionOscDispatch(const wchar_t /*wch*/,
|
||||||
fSuccess = _dispatch->SetColorTableEntry(tableIndex, dwColor);
|
fSuccess = _dispatch->SetColorTableEntry(tableIndex, dwColor);
|
||||||
TermTelemetry::Instance().Log(TermTelemetry::Codes::OSCCT);
|
TermTelemetry::Instance().Log(TermTelemetry::Codes::OSCCT);
|
||||||
break;
|
break;
|
||||||
|
case OscActionCodes::SetForegroundColor:
|
||||||
|
fSuccess = _dispatch->SetDefaultForeground(dwColor);
|
||||||
|
TermTelemetry::Instance().Log(TermTelemetry::Codes::OSCFG);
|
||||||
|
break;
|
||||||
|
case OscActionCodes::SetBackgroundColor:
|
||||||
|
fSuccess = _dispatch->SetDefaultBackground(dwColor);
|
||||||
|
TermTelemetry::Instance().Log(TermTelemetry::Codes::OSCBG);
|
||||||
|
break;
|
||||||
case OscActionCodes::SetCursorColor:
|
case OscActionCodes::SetCursorColor:
|
||||||
fSuccess = _dispatch->SetCursorColor(dwColor);
|
fSuccess = _dispatch->SetCursorColor(dwColor);
|
||||||
TermTelemetry::Instance().Log(TermTelemetry::Codes::OSCSCC);
|
TermTelemetry::Instance().Log(TermTelemetry::Codes::OSCSCC);
|
||||||
|
@ -1162,7 +1172,7 @@ bool OutputStateMachineEngine::_VerifyDeviceAttributesParams(_In_reads_(cParams)
|
||||||
// - Null terminates, then returns, the string that we've collected as part of the OSC string.
|
// - Null terminates, then returns, the string that we've collected as part of the OSC string.
|
||||||
// Arguments:
|
// Arguments:
|
||||||
// - ppwchTitle - a pointer to point to the Osc String to use as a title.
|
// - ppwchTitle - a pointer to point to the Osc String to use as a title.
|
||||||
// - pcchTitleLength - a pointer place the length of ppwchTitle into.
|
// - pcchTitle - a pointer place the length of ppwchTitle into.
|
||||||
// Return Value:
|
// Return Value:
|
||||||
// - True if there was a title to output. (a title with length=0 is still valid)
|
// - True if there was a title to output. (a title with length=0 is still valid)
|
||||||
_Success_(return)
|
_Success_(return)
|
||||||
|
@ -1476,10 +1486,12 @@ bool OutputStateMachineEngine::s_ParseColorSpec(_In_reads_(cchBuffer) const wcha
|
||||||
// "rgb:<red>/<green>/<blue>"
|
// "rgb:<red>/<green>/<blue>"
|
||||||
// where <color> is two hex digits
|
// where <color> is two hex digits
|
||||||
// Arguments:
|
// Arguments:
|
||||||
// - ppwchTitle - a pointer to point to the Osc String to use as a title.
|
// - pwchOscStringBuffer - a pointer to the Osc String to parse
|
||||||
// - pcchTitleLength - a pointer place the length of ppwchTitle into.
|
// - cchOscString - the length of the Osc String
|
||||||
|
// - pTableIndex - a pointer that recieves the table index
|
||||||
|
// - pRgb - a pointer that recieves the color that we parsed in the format: 0x00BBGGRR
|
||||||
// Return Value:
|
// Return Value:
|
||||||
// - True if there was a title to output. (a title with length=0 is still valid)
|
// - True if a table index and color was parsed successfully. False otherwise.
|
||||||
bool OutputStateMachineEngine::_GetOscSetColorTable(_In_reads_(cchOscString) const wchar_t* const pwchOscStringBuffer,
|
bool OutputStateMachineEngine::_GetOscSetColorTable(_In_reads_(cchOscString) const wchar_t* const pwchOscStringBuffer,
|
||||||
const size_t cchOscString,
|
const size_t cchOscString,
|
||||||
_Out_ size_t* const pTableIndex,
|
_Out_ size_t* const pTableIndex,
|
||||||
|
@ -1548,16 +1560,17 @@ bool OutputStateMachineEngine::_GetOscSetColorTable(_In_reads_(cchOscString) con
|
||||||
}
|
}
|
||||||
|
|
||||||
// Routine Description:
|
// Routine Description:
|
||||||
// - OSC 12 ; spec ST
|
// - OSC 10, 11, 12 ; spec ST
|
||||||
// spec: a color in the following format:
|
// spec: a color in the following format:
|
||||||
// "rgb:<red>/<green>/<blue>"
|
// "rgb:<red>/<green>/<blue>"
|
||||||
// where <color> is two hex digits
|
// where <color> is two hex digits
|
||||||
// Arguments:
|
// Arguments:
|
||||||
// - ppwchTitle - a pointer to point to the Osc String to use as a title.
|
// - pwchOscStringBuffer - a pointer to the Osc String to parse
|
||||||
// - pcchTitleLength - a pointer place the length of ppwchTitle into.
|
// - cchOscString - the length of the Osc String
|
||||||
|
// - pRgb - a pointer that recieves the color that we parsed in the format: 0x00BBGGRR
|
||||||
// Return Value:
|
// Return Value:
|
||||||
// - True if there was a title to output. (a title with length=0 is still valid)
|
// - True if a table index and color was parsed successfully. False otherwise.
|
||||||
bool OutputStateMachineEngine::_GetOscSetCursorColor(_In_reads_(cchOscString) const wchar_t* const pwchOscStringBuffer,
|
bool OutputStateMachineEngine::_GetOscSetColor(_In_reads_(cchOscString) const wchar_t* const pwchOscStringBuffer,
|
||||||
const size_t cchOscString,
|
const size_t cchOscString,
|
||||||
_Out_ DWORD* const pRgb) const
|
_Out_ DWORD* const pRgb) const
|
||||||
{
|
{
|
||||||
|
|
|
@ -131,8 +131,13 @@ namespace Microsoft::Console::VirtualTerminal
|
||||||
SetIconAndWindowTitle = 0,
|
SetIconAndWindowTitle = 0,
|
||||||
SetWindowIcon = 1,
|
SetWindowIcon = 1,
|
||||||
SetWindowTitle = 2,
|
SetWindowTitle = 2,
|
||||||
|
SetWindowProperty = 3, // Not implemented
|
||||||
SetColor = 4,
|
SetColor = 4,
|
||||||
|
SetForegroundColor = 10,
|
||||||
|
SetBackgroundColor = 11,
|
||||||
SetCursorColor = 12,
|
SetCursorColor = 12,
|
||||||
|
ResetForegroundColor = 110, // Not implemented
|
||||||
|
ResetBackgroundColor = 111, // Not implemented
|
||||||
ResetCursorColor = 112,
|
ResetCursorColor = 112,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -251,9 +256,9 @@ namespace Microsoft::Console::VirtualTerminal
|
||||||
const size_t cchBuffer,
|
const size_t cchBuffer,
|
||||||
_Out_ DWORD* const pRgb);
|
_Out_ DWORD* const pRgb);
|
||||||
|
|
||||||
bool _GetOscSetCursorColor(_In_reads_(cchOscString) const wchar_t* const pwchOscStringBuffer,
|
bool _GetOscSetColor(_In_reads_(cchOscString) const wchar_t* const pwchOscStringBuffer,
|
||||||
const size_t cchOscString,
|
const size_t cchOscString,
|
||||||
_Out_ DWORD* const pRgb) const;
|
_Out_ DWORD* const pRgb) const;
|
||||||
|
|
||||||
static const DispatchTypes::CursorStyle s_defaultCursorStyle = DispatchTypes::CursorStyle::BlinkingBlockDefault;
|
static const DispatchTypes::CursorStyle s_defaultCursorStyle = DispatchTypes::CursorStyle::BlinkingBlockDefault;
|
||||||
_Success_(return)
|
_Success_(return)
|
||||||
|
|
|
@ -243,6 +243,8 @@ void TermTelemetry::WriteFinalTraceLog() const
|
||||||
TraceLoggingUInt32(_uiTimesUsed[OSCCT], "OscColorTable"),
|
TraceLoggingUInt32(_uiTimesUsed[OSCCT], "OscColorTable"),
|
||||||
TraceLoggingUInt32(_uiTimesUsed[OSCSCC], "OscSetCursorColor"),
|
TraceLoggingUInt32(_uiTimesUsed[OSCSCC], "OscSetCursorColor"),
|
||||||
TraceLoggingUInt32(_uiTimesUsed[OSCRCC], "OscResetCursorColor"),
|
TraceLoggingUInt32(_uiTimesUsed[OSCRCC], "OscResetCursorColor"),
|
||||||
|
TraceLoggingUInt32(_uiTimesUsed[OSCFG], "OscForegroundColor"),
|
||||||
|
TraceLoggingUInt32(_uiTimesUsed[OSCBG], "OscBackgroundColor"),
|
||||||
TraceLoggingUInt32(_uiTimesUsed[REP], "REP"),
|
TraceLoggingUInt32(_uiTimesUsed[REP], "REP"),
|
||||||
TraceLoggingUInt32Array(_uiTimesFailed, ARRAYSIZE(_uiTimesFailed), "Failed"),
|
TraceLoggingUInt32Array(_uiTimesFailed, ARRAYSIZE(_uiTimesFailed), "Failed"),
|
||||||
TraceLoggingUInt32(_uiTimesFailedOutsideRange, "FailedOutsideRange"));
|
TraceLoggingUInt32(_uiTimesFailedOutsideRange, "FailedOutsideRange"));
|
||||||
|
|
|
@ -83,6 +83,8 @@ namespace Microsoft::Console::VirtualTerminal
|
||||||
OSCSCC,
|
OSCSCC,
|
||||||
OSCRCC,
|
OSCRCC,
|
||||||
REP,
|
REP,
|
||||||
|
OSCFG,
|
||||||
|
OSCBG,
|
||||||
// Only use this last enum as a count of the number of codes.
|
// Only use this last enum as a count of the number of codes.
|
||||||
NUMBER_OF_CODES
|
NUMBER_OF_CODES
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue