Skip to content

Commit 82ad8bb

Browse files
committed
I _think_ this will pull the settings from the control, but I haven't tested yet
1 parent 8ed39cd commit 82ad8bb

File tree

4 files changed

+21
-6
lines changed

4 files changed

+21
-6
lines changed

src/cascadia/TerminalApp/TerminalPage.cpp

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -827,11 +827,19 @@ namespace winrt::TerminalApp::implementation
827827
{
828828
auto focusedTab = _GetStrongTabImpl(*index);
829829
const auto& profileGuid = focusedTab->GetFocusedProfile();
830-
if (profileGuid.has_value())
830+
auto activeControl = focusedTab->GetActiveTerminalControl();
831+
auto iControlSettings = activeControl.Settings();
832+
if (profileGuid.has_value() && iControlSettings)
831833
{
832-
const auto settings = _settings->BuildSettings(profileGuid.value());
833-
_CreateNewTabFromSettings(profileGuid.value(), settings);
834+
if (auto settings{ iControlSettings.as<TerminalSettings>() })
835+
{
836+
_CreateNewTabFromSettings(profileGuid.value(), settings);
837+
}
834838
}
839+
// if (profileGuid.has_value())
840+
// {
841+
// const auto settings = _settings->BuildSettings(profileGuid.value());
842+
// }
835843
}
836844
CATCH_LOG();
837845
// TODO: Should we display a dialog when we do nothing because we

src/cascadia/TerminalControl/TermControl.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2352,6 +2352,11 @@ namespace winrt::Microsoft::Terminal::TerminalControl::implementation
23522352
e.DragUIOverride().IsGlyphVisible(false);
23532353
}
23542354

2355+
winrt::Microsoft::Terminal::Settings::IControlSettings TermControl::Settings() const
2356+
{
2357+
return _settings;
2358+
}
2359+
23552360
// -------------------------------- WinRT Events ---------------------------------
23562361
// Winrt events need a method for adding a callback to the event and removing the callback.
23572362
// These macros will define them both for you.

src/cascadia/TerminalControl/TermControl.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,8 @@ namespace winrt::Microsoft::Terminal::TerminalControl::implementation
9494

9595
static Windows::Foundation::Point GetProposedDimensions(Microsoft::Terminal::Settings::IControlSettings const& settings, const uint32_t dpi);
9696

97+
Settings::IControlSettings Settings() const;
98+
9799
// clang-format off
98100
// -------------------------------- WinRT Events ---------------------------------
99101
DECLARE_EVENT(TitleChanged, _titleChangedHandlers, TerminalControl::TitleChangedEventArgs);

src/cascadia/TerminalControl/TermControl.idl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,7 @@ namespace Microsoft.Terminal.TerminalControl
1212
// If you update this one, please update TerminalApp\IF7Listener.idl.
1313
// If you change this interface, please update the guid.
1414
// If you press F7 and get a runtime error, go make sure both copies are the same.
15-
[uuid("339e1a87-5315-4da6-96f0-565549b6472b")]
16-
interface IF7Listener
17-
{
15+
[uuid("339e1a87-5315-4da6-96f0-565549b6472b")] interface IF7Listener {
1816
Boolean OnF7Pressed();
1917
}
2018

@@ -68,5 +66,7 @@ namespace Microsoft.Terminal.TerminalControl
6866

6967
void AdjustFontSize(Int32 fontSizeDelta);
7068
void ResetFontSize();
69+
70+
Microsoft.Terminal.Settings.IControlSettings Settings { get; };
7171
}
7272
}

0 commit comments

Comments
 (0)