Skip to content

v0.30.2

animation

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.

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! 🐀

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 safely

Ratatui 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.

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 1
Span::raw("你好,世界!").bg(Color::Blue);
// frame 2
Span::raw("Hello");

First frame (blue background):

0 1 2 3 4 5 6 7 8 9 10 11

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:

0 1 2 3 4 5 6 7 8 9 10 11 H e l l o

Now this is fixed, and those trailing cells are cleaned up:

0 1 2 3 4 5 6 7 8 9 10 11 H e l l o

See the pull request for more details.

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:

Image

After:

Image
  • Add cargo-udeps dependency check in CI and remove unused dependencies

Thanks for using Ratatui and see you in the next release! 🐀


a gift