Repository navigation
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. This release does not publish them to crates.io. You still install them with a Git dependency and 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
opentuiandopentui-sysare now namedanomalyco-opentuiandanomalyco-opentui-sys. Addpackage = "anomalyco-opentui"to a Git or path dependency, and use the new names withcargo -pand--features. See Install, link, and ship. (#2167)
Added
- native: Rust
input::decode_paste_bytesandinput::strip_ansi_sequenceswork like Core'sdecodePasteBytesandstripAnsiSequences. See Events, focus, and input. (#2160) - native: Rust
Keymap::parse_bindingparses 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_countreturns the number of final top-level blocks, like Core'scommittedBlockCount, so an app can move streamed rows to scrollback. See Code, Markdown, and highlighting. (#2160) - native: Rust
ImageView::fitted_sizeworks like Core'sgetFittedSize, andImageView::cell_aspectreturns the cell aspect ratio that native painting uses. See Images, video, sound, and terminals. (#2160) - native: Rust
Color::parseaccepts#rgba, asRGBA.fromHexdoes, andContext::measure_edit_textworks like Core'smeasureEditText. See Widgets and layout. (#2160)
Changed
- native: Rust
TextareaandInputkeep control characters in text fromset_text,set_value, andinsert, as Core does, and show them as notation such as^G.Inputdrops 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, andonPastehandlers do not change. See Textarea. (#2162) - native: Rust
TextareaandInputpastes 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)
API changes and documentation: https://opentui.com/docs/releases/0.9.4
What's Changed
- rust: add the color, paste, keymap, Markdown and image helpers Core has by @simonklee in #2160
- ci: skip native tests and overlap the native build on release commits by @simonklee in #2161
- core: drop control characters from pastes as Rust does by @simonklee in #2162
- web: use OpenMono as the site typeface by @iamdavidhill in #2159
- rust: keep control characters in editor text as Core does by @simonklee in #2163
- web: name Rust, the C API, and video in the project description by @simonklee in #2165
- web: size open header panels from the real header height by @simonklee in #2166
- web: move the Rust guide into the docs by @simonklee in #2164
- rust: make the crates publishable on crates.io by @simonklee in #2167
- Release v0.9.4 by @simonklee in #2168
Full Changelog: v0.9.3...v0.9.4