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

Use available terminal columns instead of hardcoded 80 columns #11404

Merged
merged 3 commits into from Nov 22, 2023

Conversation

kLabz
Copy link
Contributor

@kLabz kLabz commented Nov 22, 2023

Using https://github.com/cryptosense/terminal_size, detect available terminal columns instead of hardcoded 80 columns when possible. Helps with help messages, for example.

Haven't tested on windows myself

@Simn
Copy link
Member

Simn commented Nov 22, 2023

This is missing the dune entry.

And I just tested, works for me. But I don't think it should call get_columns on every limit_string call.

@kLabz
Copy link
Contributor Author

kLabz commented Nov 22, 2023

Whoops, aborted git add -p a bit too soon
Also yeah, will store the result

Thanks for testing!

@@ -2,8 +2,16 @@ open Globals
open Common
open CompilationContext

let terminal_width = ref None
let get_columns = match !terminal_width with
Copy link
Member

Choose a reason for hiding this comment

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

This isn't a function and executes immediately, so the terminal_width above is useless.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

damn, I knew I shouldn't hurry to deal with it before getting out x_x

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nice, didn't know about lazy

@Simn Simn merged commit b588672 into development Nov 22, 2023
122 checks passed
@skial skial mentioned this pull request Nov 28, 2023
1 task
0b1kn00b pushed a commit to 0b1kn00b/haxe that referenced this pull request Jan 25, 2024
…oundation#11404)

* Use available terminal columns instead of hardcoded 80 columns

* hotfix on phone

* embrace laziness

---------

Co-authored-by: Rudy G <pocket@kla.bz>
Co-authored-by: Simon Krajewski <simon@haxe.org>
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.

None yet

2 participants