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

utop overwrites Format.std_formatter geometry #487

Open
sim642 opened this issue Jun 27, 2024 · 0 comments
Open

utop overwrites Format.std_formatter geometry #487

sim642 opened this issue Jun 27, 2024 · 0 comments

Comments

@sim642
Copy link

sim642 commented Jun 27, 2024

I was screwing around with ocaml/ocaml#11517 and became really confused when even small Format margins wouldn't work. Apparently utop is overwriting Format.std_formatter geometry, so the same commands in utop and OCaml's own toplevel give different results.
Is this intentional somehow?

I would understand utop setting the margin based on terminal size initially, but overwriting it after/before every command gives the impression that Stdlib doesn't work.

utop

──────────┬──────────────────────────────────────────────────────────────┬───────────
          │ Welcome to utop version 2.14.0 (using OCaml version 4.14.2)! │           
          └──────────────────────────────────────────────────────────────┘           

Type #utop_help for help about using utop.

─( 11:23:44 )─< command 0 >───────────────────────────────────────────{ counter: 0 }─
utop # Format.get_margin ();;
- : int = 80
─( 11:23:44 )─< command 1 >───────────────────────────────────────────{ counter: 0 }─
utop # Format.set_margin 1000000;;
- : unit = ()
─( 11:23:48 )─< command 2 >───────────────────────────────────────────{ counter: 0 }─
utop # Format.get_margin ();;
- : int = 80

ocaml

OCaml version 4.14.2
Enter #help;; for help.

# Format.get_margin ();;
- : int = 78
# Format.set_margin 1000000;;
- : unit = ()
# Format.get_margin ();;
- : int = 1000000
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

No branches or pull requests

1 participant