Here is the patch we have in ocaml-dune/notty: https://github.com/pqwy/notty/commit/bb4ab8e99a3ac66d2147d083d38c5213bf482c9f here is the patch from @MisterDA: https://github.com/pqwy/notty/pull/52/commits/c5b5653280c15b8e80206f7d8f7dba330fce2aa6 We should compare these patches. I've tested the dune one on windows and it works fine for detecting the terminal size. @MisterDA might want to add something.