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

Add terminal width fallback via stty if on windows/MSYS2 #1030

Merged
merged 2 commits into from
Oct 11, 2022

Conversation

th1000s
Copy link
Collaborator

@th1000s th1000s commented Mar 31, 2022

No description provided.

Also new workarounds.rs file, and DELTA_NO_WORKAROUNDS env var
to disable these.
@th1000s th1000s marked this pull request as ready for review October 10, 2022 20:10
@th1000s
Copy link
Collaborator Author

th1000s commented Oct 10, 2022

I could finally verify that this workaround fixes the problem on Windows.

Also added a DELTA_NO_WORKAROUNDS env var to make future debugging easier, e.g. when eminence/terminal-size#25 is fixed.


#[cfg(not(target_os = "windows"))]
pub fn windows_msys2_width_fix(height_width: (u16, u16), _: &console::Term) -> usize {
let _ = NO_WORKAROUNDS;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's this for?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just so this const &str does not trigger an unused variable warning in the non-windows case.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah of course, thanks.

@dandavison dandavison merged commit 60492f3 into dandavison:master Oct 11, 2022
@dandavison
Copy link
Owner

Thank you @th1000s.

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.

2 participants