OpenTUI 0.9.4

npmGitHub release

A Git dependency on the Rust crate must now name its package:

[dependencies.opentui]
git = "https://github.com/anomalyco/opentui"
tag = "v0.9.4"
package = "anomalyco-opentui"

The crates are now ready for crates.io, but the names opentui and opentui-sys belong to an unrelated project there. For now, the packages are anomalyco-opentui and anomalyco-opentui-sys. The library names do not change, so use opentui::... lines stay the same now and after the crates get their real names. A path dependency needs the same package line. cargo -p and --features take the package names. opentui-ssh keeps its name. The crates require each other at the exact version, and they need Rust 1.88, not 1.85 as the documentation said. Version 0.9.4 of the three crates is on crates.io. Add them with cargo add anomalyco-opentui --rename opentui and link the native archive from the same release, as Install, link, and ship describes.

Core and Rust editors now handle control characters the same way. Text that an app sets keeps them. Call setText("A\x07B") on a Core Textarea or set_text("A\x07B") on a Rust Textarea, and the buffer keeps the BEL and shows it as ^G. Before, Rust dropped it and stored "AB". Pasted text loses them. Both bindings first remove escape sequences, then every control character except tab, LF, and CR. Before, a Core paste kept NUL, BEL, form feed, DEL, and NEL and showed them as notation. A Rust paste left the body of a C1 control string in the text. Typed keys never carry control characters, and Core onPaste handlers still get the raw bytes.

Breaking changes

  • native: The Rust packages opentui and opentui-sys are now named anomalyco-opentui and anomalyco-opentui-sys. Add package = "anomalyco-opentui" to a Git or path dependency, and use the new names with cargo -p and --features. See Install, link, and ship. (#2167)

Added

  • native: Rust input::decode_paste_bytes and input::strip_ansi_sequences work like Core’s decodePasteBytes and stripAnsiSequences. See Events, focus, and input. (#2160)
  • native: Rust Keymap::parse_binding parses a key the same way that layer registration does, with comma lists and key aliases expanded. See Rust keymap. (#2160)
  • native: Rust Markdown::committed_block_count returns the number of final top-level blocks, like Core’s committedBlockCount, so an app can move streamed rows to scrollback. See Code, Markdown, and highlighting. (#2160)
  • native: Rust ImageView::fitted_size works like Core’s getFittedSize, and ImageView::cell_aspect returns the cell aspect ratio that native painting uses. See Images, video, sound, and terminals. (#2160)
  • native: Rust Color::parse accepts #rgba, as RGBA.fromHex does, and Context::measure_edit_text works like Core’s measureEditText. See Widgets and layout. (#2160)

Changed

  • native: Rust Textarea and Input keep control characters in text from set_text, set_value, and insert, as Core does, and show them as notation such as ^G. Input drops only line breaks. See Widgets and layout. (#2163)

Fixed

  • core: A paste into a Textarea or Input now drops all control characters except tab, LF, and CR after it removes escape sequences, as Rust does. Typed keys, insertText, setText, and onPaste handlers do not change. See Textarea. (#2162)
  • native: Rust Textarea and Input pastes drop complete escape sequences, as Core does, and bracketed paste events drop a leading byte order mark. Before, a C1 control string left its body in the text. See Events, focus, and input. (#2160)

The published API did not change in this release.