crossterm-rs / crossterm

Cross platform terminal library rust
MIT License
3.28k stars 281 forks source link

serde support for Attributes #869

Open ur-fault opened 8 months ago

ur-fault commented 8 months ago

Is your feature request related to a problem? Please describe. I'm trying to save and load the ContentStyle from some kind of file or similar. It's pretty weird to serialize it as bit integer in JSON.

Describe the solution you'd like It would be much easier if Attributes implemented serde::Serialize and serde::Deserialize. Some kind of comma separated string of attributes enabled.

Describe alternatives you've considered if any Serializing it using int.

Additional context Right now I'm using it with Extism, but may use it for save/settings system.