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 reporting terminal dimensions #381

Merged
merged 5 commits into from
Sep 20, 2023
Merged

Fix reporting terminal dimensions #381

merged 5 commits into from
Sep 20, 2023

Commits on Sep 19, 2023

  1. Improve C platform detection

    - simplify macro dance;
    - enable size detection on macOS;
    - use CAML_NAME_SPACE before OCaml 5.0.
    MisterDA committed Sep 19, 2023
    Configuration menu
    Copy the full SHA
    86175b8 View commit details
    Browse the repository at this point in the history
  2. Use /dev/tty instead of stdout to get terminal size

    This allows the library to report the correct size even when test are
    run buffered with `dune runtest`, as it changes the standard output of
    the executable. The correct size was reported when the test was run
    unbuffered (e.g., with `dune exec -- test.exe`).
    MisterDA committed Sep 19, 2023
    Configuration menu
    Copy the full SHA
    d28d21f View commit details
    Browse the repository at this point in the history
  3. Check if the reported number of terminal columns is > 0

    In some platforms, incorrect reporting would lead to a division by
    zero.
    MisterDA committed Sep 19, 2023
    Configuration menu
    Copy the full SHA
    4991030 View commit details
    Browse the repository at this point in the history
  4. Enable detection of terminal size on Windows

    Even though we had the C stubs, it was disabled in OCaml code.
    MisterDA committed Sep 19, 2023
    Configuration menu
    Copy the full SHA
    baf15e4 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    846cf88 View commit details
    Browse the repository at this point in the history