What is a good crate to output coloured text on terminal?

I know that there are crates such as colored and crossterm but I wanted to know what is the best (in terms of ease of use, development of the project and most customisable) colored crate out there that outputs coloured text onto the screen and has the ability to produce something like this:

this image is from bashtop

I've only used termion which is super-easy but I had problems on Windows so I switched to crossterm. It's more typing and I'm not convinced some of the abstractions are helpful but it's still straightforward enough and the switch was easy.

If I were trying to write an interactive UI I'd probably go with something higher level like tui-rs.

Is this a problem in Linux as well since I want to develop something for Linux?

Can it produce this kind of UI for terminal-based applications?


Is this also straight forward the tui-rs? Is it as easy to write as termion?

It worked fine on Linux but not in Windows. termion seems to be older than crossterm so I'm not sure if it's still maintained.

termion is a lot lower level than tui-rs so you'll have to do your own windows, resizing, layouts. If that's what you want, use termion or crossterm. If you want the crate to deal with layouts, etc. try tui-rs. It seems like tui-rs is more than capable of rendering something like bashtop, it renders Widgets into lower level Buffers that are similar to what you'd do in termion or crossterm.

Look at the docs and examples and you'll see.

1 Like