Closed richardszalay closed 5 years ago
I've confirmed that the root cause of the error is that splitting small panes results in a width/height of 0, which causes the DxRenderer to fail when creating the device resources.
I'd like to PR this if you don't mind. Here's my proposed implementation, but I'm happy to PR it as a spec if you think the issue warrants it:
App::_SplitPane
will call focusedTab->CanAddHorizontalSplit/CanAddHorizontalSplit
before it initializes the TermControl
to avoid having to deal with the cleanup. If a split cannot occur, it will simply return. Question Should we beep or something here?
I'll follow the same naming conventions that already exist, so: Tab::CanAddHorizontalSplit -> Pane::CanSplitHorizontal ->Pane::_CanSplit
. The public pane methods will handle leaf/child the same as the current Split methods.
_CanSplit
will reuse existing logic to determine the split, including _root.GetActualWidth/height
, Pane::_GetMinSize
, and the Half
constant.
If you're happy with my proposed design and don't think it needs a beep, I've submitted a PR.
Yea I definitely don't think we need a beep currently. We don't beep for anything else quite yet, so we could always add a (optional) beep here later when we add beeps to the rest of the app.
Good work with the PR!
:tada:This issue was addressed in #2450, which has now been successfully released as Windows Terminal Preview v0.4.2382.0
.:tada:
Handy links:
Environment
Steps to reproduce
splitHorizontal
splitHorizontal
key binding beyond the point where space is available for the split (~6-7 times)NOTE: It also happens when splitting vertically but it appears to allow more before crashing.
Expected behavior
Worth discussing, but I'm guessing it would simply reject the command and perform a system beep (or some other indication of the failure)
Actual behavior
Application crash