crossterm
crossterm copied to clipboard
Resize events yield different results than `terminal::size` on Windows
Describe the bug
On Windows, the Resize event yields results that are 1 less than the results from terminal::size.
To Reproduce
- Use crossterm on Windows
- Call
terminal::size; store results - Enter raw mode so events are processed
- Enter alternate screen so that Resize events are fired properly (required on CMD and PowerShell, not required on Windows Terminal)
- Call
event::readand store the results of the firstEvent::Resize - Leave alternate screen (if it was entered) and disable raw mode
- Compare results from
terminal::sizeandEvent::Resize
Expected behavior
Results from Resize events match results from terminal::size
OS Windows 10 (10.0.19044 Build 19044)
Terminal/Console CMD, PowerShell, and Windows Terminal
It seems like the underlying issue is that the results from terminal::size have 1 added in each dimension, but the results from a Resize event never have anything added to them.
Opened PR #714 to fix this issue.