@@ -2144,11 +2144,14 @@ std::pair<std::shared_ptr<Pane>, std::shared_ptr<Pane>> Pane::_Split(SplitState
2144
2144
std::unique_lock lock{ _createCloseLock };
2145
2145
2146
2146
const auto & termControl{ _control.try_as <TermControl>() };
2147
- // revoke our handler - the child will take care of the control now.
2148
- termControl.ConnectionStateChanged (_connectionStateChangedToken);
2149
- _connectionStateChangedToken.value = 0 ;
2150
- termControl.WarningBell (_warningBellToken);
2151
- _warningBellToken.value = 0 ;
2147
+ if (termControl)
2148
+ {
2149
+ // revoke our handler - the child will take care of the control now.
2150
+ termControl.ConnectionStateChanged (_connectionStateChangedToken);
2151
+ termControl.WarningBell (_warningBellToken);
2152
+ _connectionStateChangedToken.value = 0 ;
2153
+ _warningBellToken.value = 0 ;
2154
+ }
2152
2155
2153
2156
// Remove our old GotFocus handler from the control. We don't what the
2154
2157
// control telling us that it's now focused, we want it telling its new
@@ -2584,6 +2587,15 @@ void Pane::_AdvanceSnappedDimension(const bool widthOrHeight, LayoutSizeNode& si
2584
2587
sizeNode.size += widthOrHeight ? cellSize.Width : cellSize.Height ;
2585
2588
}
2586
2589
}
2590
+ else if (_IsLeaf ())
2591
+ {
2592
+ // If we're a leaf that didn't have a TermControl, then just increment
2593
+ // by one. We have to increment by _some_ value, because this is used in
2594
+ // a while() loop to find the next bigger size we can snap to. But since
2595
+ // a non-terminal control doesn't really care what size it's snapped to,
2596
+ // we can just say "one pixel larger is the next snap point"
2597
+ sizeNode.size += 1 ;
2598
+ }
2587
2599
else if (!_IsLeaf ())
2588
2600
{
2589
2601
// We're a parent pane, so we have to advance dimension of our children panes. In
@@ -2877,7 +2889,9 @@ std::optional<SplitState> Pane::PreCalculateAutoSplit(const std::shared_ptr<Pane
2877
2889
bool Pane::ContainsReadOnly () const
2878
2890
{
2879
2891
const auto & termControl{ GetTerminalControl () };
2880
- return termControl ? termControl.ReadOnly () : (_firstChild->ContainsReadOnly () || _secondChild->ContainsReadOnly ());
2892
+ return termControl ?
2893
+ termControl.ReadOnly () :
2894
+ (_IsLeaf () ? false : (_firstChild->ContainsReadOnly () || _secondChild->ContainsReadOnly ()));
2881
2895
}
2882
2896
2883
2897
// Method Description:
0 commit comments