Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resize events yield different results than terminal::size on Windows #713

Closed
generic-user1 opened this issue Sep 20, 2022 · 2 comments · Fixed by #714
Closed

Resize events yield different results than terminal::size on Windows #713

generic-user1 opened this issue Sep 20, 2022 · 2 comments · Fixed by #714

Comments

@generic-user1
Copy link
Contributor

generic-user1 commented Sep 20, 2022

Describe the bug
On Windows, the Resize event yields results that are 1 less than the results from terminal::size.

To Reproduce

  1. Use crossterm on Windows
  2. Call terminal::size; store results
  3. Enter raw mode so events are processed
  4. Enter alternate screen so that Resize events are fired properly (required on CMD and PowerShell, not required on Windows Terminal)
  5. Call event::read and store the results of the first Event::Resize
  6. Leave alternate screen (if it was entered) and disable raw mode
  7. Compare results from terminal::size and Event::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

@generic-user1
Copy link
Contributor Author

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.

@generic-user1
Copy link
Contributor Author

Opened PR #714 to fix this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant