terminal/src/cascadia/TerminalCore
Mike Griese 1ce86f8f1a
Clamp the new rows scrolling value to a positive number (#5630)
## Summary of the Pull Request

This PR clamp the "new rows" scrolling value to a positive number. We can't create a negative number of new rows. It also adds a test.

## References

## PR Checklist
* [x] Closes #5540
* [x] I work here
* [x] Tests added/passed
* [n/a] Requires documentation to be updated

## Detailed Description of the Pull Request / Additional comments

The origin of this bug is that as newlines are emitted, we'll accumulate an enormous scroll delta into a selection region, to the point of overflowing a `SHORT`. When the overflow occurs, the `Terminal` would fail to send a `NotifyScroll()` to the `TermControl` hosting it.

For this bug to repro, we need to:
- Have a sufficiently large buffer, because each newline we'll accumulate a delta of (0, ~bufferHeight), so (bufferHeight^2 + bufferHeight) > SHRT_MAX
- Have a selection

## Validation Steps Performed
* Dustin verified this actually
* Created a new insane test case
2020-04-29 19:28:59 +00:00
..
lib Apply audit mode to TerminalConnection/Core/Settings and WinCon… (#4016) 2020-01-03 10:44:27 -08:00
ControlKeyStates.hpp Manually pass mouse wheel messages to TermControls (#5131) 2020-04-01 16:58:16 +00:00
ITerminalApi.hpp Add support for setting the cursor visibility in Terminal (#4902) 2020-03-13 17:39:42 +00:00
ITerminalInput.hpp Delegate all character input to the character event handler (#4192) 2020-04-07 19:09:28 +00:00
packages.config deps: upgrade CppWinRT to 2.0.200316.3, gsl to v2.1.0 (#4536) 2020-03-23 17:15:24 +00:00
pch.cpp Initial release of the Windows Terminal source code 2019-05-02 15:29:04 -07:00
pch.h Initial release of the Windows Terminal source code 2019-05-02 15:29:04 -07:00
Terminal.cpp Clamp the new rows scrolling value to a positive number (#5630) 2020-04-29 19:28:59 +00:00
Terminal.hpp Clamp the new rows scrolling value to a positive number (#5630) 2020-04-29 19:28:59 +00:00
TerminalApi.cpp ci: run spell check in CI, fix remaining issues (#4799) 2020-03-25 11:02:53 -07:00
terminalcore-common.vcxitems Unify and clean up the common build properties (#3429) 2019-11-05 14:29:11 -08:00
TerminalDispatch.cpp Implement Hard Reset for Terminal (#4909) 2020-03-16 15:32:01 +00:00
TerminalDispatch.hpp Implement Hard Reset for Terminal (#4909) 2020-03-16 15:32:01 +00:00
TerminalDispatchGraphics.cpp Apply audit mode to TerminalConnection/Core/Settings and WinCon… (#4016) 2020-01-03 10:44:27 -08:00
terminalrenderdata.cpp Make sure background color is opaque when attrs are reversed (#5509) 2020-04-23 14:35:12 -07:00
TerminalSelection.cpp Rename copy keybinding arg (#5216) 2020-04-02 23:10:28 +00:00