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

Implement getTerminalWidth for Windows #4779

Closed

Conversation

NeonGraal
Copy link
Contributor

@NeonGraal NeonGraal commented Apr 28, 2019

Please include the following checklist in your PR:

  • Any changes that could be relevant to users have been recorded in the ChangeLog.md
  • The documentation has been updated, if necessary.

Please also shortly describe how you tested your change. Bonus points for added tests!

Tests

I temporarily added a putStrLn "!!!" just before the getWidth call in getTerminalWidth to be sure that the function was being called.
I then ran the modified stack with stack run stack -- ls stack-color and got the "!!!"
To check the non-console case I ran the above command with the stdout and stderr redirected to files

@NeonGraal
Copy link
Contributor Author

Resolve 3588

@snoyberg
Copy link
Contributor

The last comment in the referenced issue (#3588) mentions the terminal-size library. Is there a reason you didn't go with that approach? My concern here is that this change introduces lower bounds on a few packages that ship with GHC, which we typically try to avoid doing.

@NeonGraal
Copy link
Contributor Author

Ah. I went the way of upgrading an existing dependency rather than including a new one. Didn't realise the lower bounds issue.

At first look using the terminal-size package may actually allow me to delete some code.

Which would you prefer, I commit a revert here and then another with the new change or cancel this PR and raise a new one.

@snoyberg
Copy link
Contributor

snoyberg commented May 1, 2019

No strong preference to be honest, take your pick. If you pushed me for an answer, I'd probably lean towards new PR.

@NeonGraal
Copy link
Contributor Author

Implemented better in [https://github.com//pull/4797]

@NeonGraal NeonGraal closed this May 4, 2019
@NeonGraal NeonGraal deleted the win-terminal-width branch May 4, 2019 01:11
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