[llvm] [lit] cross platform progress bar (PR #189970)

Charles Zablit via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 7 04:16:37 PDT 2026


charles-zablit wrote:

> How does this work on Windows when you redirect the lit output to a file or a dumb terminal? The `curses.setup_term` on the POSIX side will handle that.

With an output file or dumb terminal, `GetConsoleMode` or `SetConsoleMode` will fail. `CLEAR_EOL` will never be set, so `ProgressBar.__init__` will raise a `ValueError` with `"Terminal isn't capable enough -- you should use a simpler progress dispaly."`. This will cause to fallback to a simple progress bar, which is the current behavior on Windows.

> 
> Will `os.get_terminal_size` have the same effect on Windows?

According to [the docs](https://docs.python.org/3/library/os.html#os.get_terminal_size) it's available on both UNIX and Windows as of 3.3. From my tests at desks, it has the same effect.



https://github.com/llvm/llvm-project/pull/189970


More information about the llvm-commits mailing list