Skip to content

Commit

Permalink
argument/option for passthrough mode
Browse files Browse the repository at this point in the history
  • Loading branch information
miniksa committed Sep 17, 2021
1 parent 668e8a4 commit a19198a
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 9 deletions.
6 changes: 1 addition & 5 deletions src/cascadia/TerminalApp/TerminalPage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -892,7 +892,6 @@ namespace winrt::TerminalApp::implementation
::base::saturated_cast<uint32_t>(settings.InitialCols()),
winrt::guid());


if constexpr (Feature_VtPassthroughMode::IsEnabled())
{
valueSet.Insert(L"passthroughMode", Windows::Foundation::PropertyValue::CreateBoolean(settings.VtPassthrough()));
Expand Down Expand Up @@ -944,10 +943,7 @@ namespace winrt::TerminalApp::implementation
::base::saturated_cast<uint32_t>(settings.InitialCols()),
winrt::guid());

if constexpr (Feature_VtPassthroughMode::IsEnabled())
{
valueSet.Insert(L"passthroughMode", Windows::Foundation::PropertyValue::CreateBoolean(settings.VtPassthrough()));
}
valueSet.Insert(L"passthroughMode", Windows::Foundation::PropertyValue::CreateBoolean(settings.VtPassthrough()));

conhostConn.Initialize(valueSet);

Expand Down
8 changes: 5 additions & 3 deletions src/cascadia/TerminalConnection/TerminalConnection.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,9 @@
<Midl Include="AzureConnection.idl" />
</ItemGroup>
<ItemGroup>
<PRIResource Include="Resources\en-US\Resources.resw" />
<PRIResource Include="Resources\en-US\Resources.resw">
<SubType>Designer</SubType>
</PRIResource>
<OCResourceDirectory Include="Resources" />
<None Include="packages.config" />
</ItemGroup>
Expand Down Expand Up @@ -88,11 +90,11 @@
</Target>
<ItemDefinitionGroup>
<ClCompile>
<AdditionalIncludeDirectories>$(IntDir)..\OpenConsoleProxy;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>$(IntDir)..\OpenConsoleProxy;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<AdditionalDependencies>$(OpenConsoleCommonOutDir)\conptylib.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<Import Project="$(SolutionDir)build\rules\CollectWildcardResources.targets" />
</Project>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
<Midl Include="EchoConnection.idl" />
<Midl Include="AzureConnection.idl" />
<Midl Include="ConptyConnection.idl" />
<Midl Include="ConnectionInformation.idl" />
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
Expand Down
4 changes: 4 additions & 0 deletions src/cascadia/TerminalSettingsModel/Profile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ static constexpr std::string_view AltGrAliasingKey{ "altGrAliasing" };

static constexpr std::string_view ConnectionTypeKey{ "connectionType" };
static constexpr std::string_view CommandlineKey{ "commandline" };
static constexpr std::string_view VtPassthroughKey{ "experimental.connection.passthroughMode" };
static constexpr std::string_view FontInfoKey{ "font" };
static constexpr std::string_view AcrylicTransparencyKey{ "acrylicOpacity" };
static constexpr std::string_view UseAcrylicKey{ "useAcrylic" };
Expand Down Expand Up @@ -108,6 +109,7 @@ winrt::com_ptr<Profile> Profile::CopySettings(winrt::com_ptr<Profile> source)
profile->_AltGrAliasing = source->_AltGrAliasing;
profile->_BellStyle = source->_BellStyle;
profile->_ConnectionType = source->_ConnectionType;
profile->_VtPassthrough = source->_VtPassthrough;
profile->_Origin = source->_Origin;

// Copy over the font info
Expand Down Expand Up @@ -356,6 +358,7 @@ void Profile::LayerJson(const Json::Value& json)
// Control Settings
JsonUtils::GetValueForKey(json, ConnectionTypeKey, _ConnectionType);
JsonUtils::GetValueForKey(json, CommandlineKey, _Commandline);
JsonUtils::GetValueForKey(json, VtPassthroughKey, _VtPassthrough);
JsonUtils::GetValueForKey(json, AcrylicTransparencyKey, _AcrylicOpacity);
JsonUtils::GetValueForKey(json, UseAcrylicKey, _UseAcrylic);
JsonUtils::GetValueForKey(json, SuppressApplicationTitleKey, _SuppressApplicationTitle);
Expand Down Expand Up @@ -548,6 +551,7 @@ Json::Value Profile::ToJson() const
// Control Settings
JsonUtils::SetValueForKey(json, ConnectionTypeKey, _ConnectionType);
JsonUtils::SetValueForKey(json, CommandlineKey, _Commandline);
JsonUtils::SetValueForKey(json, VtPassthroughKey, _VtPassthrough);
JsonUtils::SetValueForKey(json, AcrylicTransparencyKey, _AcrylicOpacity);
JsonUtils::SetValueForKey(json, UseAcrylicKey, _UseAcrylic);
JsonUtils::SetValueForKey(json, SuppressApplicationTitleKey, _SuppressApplicationTitle);
Expand Down
1 change: 1 addition & 0 deletions src/cascadia/TerminalSettingsModel/Profile.h
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ namespace winrt::Microsoft::Terminal::Settings::Model::implementation

INHERITABLE_SETTING(Model::Profile, hstring, Commandline, L"cmd.exe");
INHERITABLE_SETTING(Model::Profile, hstring, StartingDirectory);
INHERITABLE_SETTING(Model::Profile, bool, VtPassthrough, false);

INHERITABLE_SETTING(Model::Profile, Microsoft::Terminal::Control::TextAntialiasingMode, AntialiasingMode, Microsoft::Terminal::Control::TextAntialiasingMode::Grayscale);
INHERITABLE_SETTING(Model::Profile, bool, ForceFullRepaintRendering, false);
Expand Down
1 change: 1 addition & 0 deletions src/cascadia/TerminalSettingsModel/Profile.idl
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ namespace Microsoft.Terminal.Settings.Model
INHERITABLE_PROFILE_SETTING(Microsoft.Terminal.Control.ScrollbarState, ScrollState);
INHERITABLE_PROFILE_SETTING(String, Padding);
INHERITABLE_PROFILE_SETTING(String, Commandline);
INHERITABLE_PROFILE_SETTING(Boolean, VtPassthrough);

INHERITABLE_PROFILE_SETTING(String, StartingDirectory);
String EvaluatedStartingDirectory { get; };
Expand Down
1 change: 1 addition & 0 deletions src/cascadia/TerminalSettingsModel/TerminalSettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,7 @@ namespace winrt::Microsoft::Terminal::Settings::Model::implementation
_Padding = profile.Padding();

_Commandline = profile.Commandline();
_VtPassthrough = profile.VtPassthrough();

_StartingDirectory = profile.EvaluatedStartingDirectory();

Expand Down
2 changes: 1 addition & 1 deletion src/winconpty/winconpty.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ HRESULT _CreatePseudoConsole(const HANDLE hToken,
bInheritCursor ? L"--inheritcursor " : L"",
bWin32InputMode ? L"--win32input " : L"",
bResizeQuirk ? L"--resizeQuirk " : L"",
bPassthroughMode ? L"--passthrough" : L"",
bPassthroughMode ? L"--passthrough " : L"",
size.X,
size.Y,
signalPipeConhostSide.get(),
Expand Down

1 comment on commit a19198a

@github-actions

This comment was marked as duplicate.

Please sign in to comment.