v0.30.2

We are excited to announce Ratatui 0.30.2! 🐁🚀🌕
This patch release adds the new ratatui-termina backend and fixes
regressions caused by the previous release.
See the changelog for the full list of changes. See the breaking changes for this release here.
Backend: ratatui-termina
Section titled “Backend: ratatui-termina”Ratatui now has a backend for Termina!
The new ratatui-termina crate is available through the termina feature and is re-exported from
the main ratatui crate:
[dependencies]ratatui = { version = "0.30.2", features = ["termina"] }use ratatui::backend::TerminaBackend;use ratatui::termina::{PlatformTerminal, Terminal as _};use ratatui::Terminal;
fn main() -> Result<(), Box<dyn std::error::Error>> { let mut output = PlatformTerminal::new()?; output.enter_raw_mode()?;
let backend = TerminaBackend::new(output); let mut terminal = Terminal::new(backend)?;
terminal.draw(|frame| { frame.render_widget("Hello from Termina!", frame.area()); })?;
Ok(())}This gives Ratatui another backend option while keeping the same Backend abstraction that widgets
and applications already use.
Let us know if you have any feedback or run into any issues with the new backend! 🐀
Widgets: Send and Sync again
Section titled “Widgets: Send and Sync again”Ratatui 0.30.1 introduced block shadows, but
the internal storage for custom shadow effects made some widgets stop implementing Send. This
showed up as compile errors in downstream apps as follows:
error[E0277]: `(dyn ratatui::widgets::CellEffect + 'static)` cannot be shared between threads safelyRatatui 0.30.2 fixes that regression! The widgets are Send and Sync again when their contents
allow it, so existing threaded app architectures should compile as before.
Buffer: Wide Cell Cleanup
Section titled “Buffer: Wide Cell Cleanup”Ratatui now correctly updates cells that are uncovered when a wide character is replaced by a normal-width cell.
Here is an example of the issue that this fix addresses:
// frame 1Span::raw("你好,世界!").bg(Color::Blue);
// frame 2Span::raw("Hello");First frame (blue background):
Note that wide characters occupy two terminal cells.
For the second frame, Hello covers columns 0..=4, but columns such as 5, 7, 9, and 11
were trailing cells from the old wide characters.
Before this fix, those cells could keep the old background:
Now this is fixed, and those trailing cells are cleaned up:
See the pull request for more details.
Scrollbar: Large Thumb at the End
Section titled “Scrollbar: Large Thumb at the End”We fixed a regression where large scrollbar thumbs could overrun the track and push the end arrow out of view when the scroll position was at the end.
Before:
After:
Other 💼
Section titled “Other 💼”- Add cargo-udeps dependency check in CI and remove unused dependencies
Thanks for using Ratatui and see you in the next release! 🐀
