fdehau / tui-rs

Build terminal user interfaces and dashboards using Rust
MIT License
10.84k stars 485 forks source link

Feature: Ability to mark terminal dirty and force a full repaint on next draw call #706

Closed karcsesz closed 1 year ago

karcsesz commented 1 year ago

Description

Adds some new functions to Cell, Buffer, and Terminal that when called marks a given object dirty, meaning their current state on the terminal is unknown, so they should be repainted the next time draw() is called.

Uses a given cell's .symbol being empty as a "dirty" marker. Not sure how proper this is for an implementation, but it seems to work well.

Testing guidelines

I've added some tests to tests/terminal.rs

Checklist

orhun commented 1 year ago

Hey, ratatui is the actively maintained fork of tui-rs. If you are interested, feel free to submit this PR to there as well. Cheers!

karcsesz commented 1 year ago

Thanks @orhun! I've ported my project over, and will see if there's a more elegant way to achieve this functionality. It is a bit of an ugly bodge.