File tree Expand file tree Collapse file tree 3 files changed +18
-2
lines changed Expand file tree Collapse file tree 3 files changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -1304,6 +1304,11 @@ TermControl Pane::GetTerminalControl() const
1304
1304
return _IsLeaf () ? _control.try_as <TermControl>() : nullptr ;
1305
1305
}
1306
1306
1307
+ Controls::UserControl Pane::GetUserControl () const
1308
+ {
1309
+ return _IsLeaf () ? _control : nullptr ;
1310
+ }
1311
+
1307
1312
// Method Description:
1308
1313
// - Recursively remove the "Active" state from this Pane and all it's children.
1309
1314
// - Updates our visuals to match our new state, including highlighting our borders.
Original file line number Diff line number Diff line change @@ -66,9 +66,10 @@ class Pane : public std::enable_shared_from_this<Pane>
66
66
const bool lastFocused = false );
67
67
68
68
std::shared_ptr<Pane> GetActivePane ();
69
- winrt::Microsoft::Terminal::Control::TermControl GetLastFocusedTerminalControl () ;
69
+ winrt::Windows::UI::Xaml::Controls::UserControl GetUserControl () const ;
70
70
winrt::Microsoft::Terminal::Control::TermControl GetTerminalControl () const ;
71
71
winrt::Microsoft::Terminal::Settings::Model::Profile GetFocusedProfile ();
72
+ winrt::Microsoft::Terminal::Control::TermControl GetLastFocusedTerminalControl ();
72
73
73
74
// Method Description:
74
75
// - If this is a leaf pane, return its profile.
Original file line number Diff line number Diff line change @@ -437,7 +437,10 @@ namespace winrt::TerminalApp::implementation
437
437
winrt::fire_and_forget TerminalTab::Scroll (const int delta)
438
438
{
439
439
auto control = GetActiveTerminalControl ();
440
-
440
+ if (!control)
441
+ {
442
+ co_return ;
443
+ }
441
444
co_await winrt::resume_foreground (control.Dispatcher ());
442
445
443
446
const auto currentOffset = control.ScrollOffset ();
@@ -1341,6 +1344,13 @@ namespace winrt::TerminalApp::implementation
1341
1344
// - The tab's color, if any
1342
1345
std::optional<winrt::Windows::UI::Color> TerminalTab::GetTabColor ()
1343
1346
{
1347
+ const auto & termControl{ GetActiveTerminalControl () };
1348
+ if (!termControl)
1349
+ {
1350
+ return std::nullopt;
1351
+ }
1352
+
1353
+ const auto currControlColor{ termControl.TabColor () };
1344
1354
std::optional<winrt::Windows::UI::Color> controlTabColor;
1345
1355
if (const auto & control = GetActiveTerminalControl ())
1346
1356
{
You can’t perform that action at this time.
0 commit comments