Crosstermion is a utility crate to unify some types of both crates, allowing to easily build apps that use the leaner termion crate on unix systems, but resort to crossterm on windows systems.

Currently provided facilities are:

But how to do colors and styles?

How to build with crossterm on Windows and termion on Unix?

There seems to be no easy way, as cargo will always build dependencies even though they are not supposed to be used on your platform. This leads to both termion and crossterm to be built, which is fatal on Windows. Thus one will have to manually select feature toggles when creating a release build, i.e. one would have to exclude all functionality that requires TUIs by default, and let the user enable the features they require.

The compile_error!(…) macro can be useful to inform users if feature selection is required. Alternatively, assure that everything compiles even without any selected backend.

Lastly, one can always give in and always compile against crossterm.

Features

All features work additively, but in case they are mutually exclusive, for instance in case of tui-react and tui, or crossterm and termion, the more general one will be chosen.