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

Fix getTermSize() for Windows #29

Merged
merged 2 commits into from
Jan 2, 2020

Conversation

vnlitvinov
Copy link
Contributor

Original approach used GetSystemMetrics() which actually returned minimal possible size of a window in pixels (most likely even without paying attention to non-zero border sizes).

I'm switching it to already used GetConsoleScreenBufferInfo() (already used in writer_windows.go) which among others returns currently visible window (from which terminal size could be easily calculated).

Without that fix uiprogress on Windows almost always clears the window because it erroneously detects overflows when they aren't actually present.

@cdrage
Copy link

cdrage commented Dec 3, 2019

I can confirm that this works for me as well, thank you @vnlitvinov

Ping @gosuri

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 this pull request may close these issues.

3 participants