Skip to content

v0.0.8

Choose a tag to compare

@github-actions github-actions released this 23 Nov 20:13
· 49 commits to main since this release
bd007ff

uncurses is a Rust library for building terminal user interfaces. It gives you a direct, framework-free way to draw to the terminal and read input — you own every cell and your own event loop, whether you run inline, take over the full screen, or mix the two.

A diffing renderer that redraws only what changed, Unicode-aware width, truecolor styling with automatic downsampling, hyperlinks, and typed keyboard, mouse, and paste input. It asks the terminal what it supports instead of looking it up in a terminfo database, so the same code runs on Linux, macOS, and Windows.

[dependencies]
uncurses = "0.0.8"

Using ratatui? uncurses-ratatui provides a backend.

Guides, concepts, and API reference: uncurses.org

Highlights

  • Correct cursor movement in tmux, with literal tabs preserved.
  • Portable tab-stop initialization and resume in tmux and GNU Screen.
  • Streaming OSC 52 clipboard replies with explicit completion and recovery.
  • Kitty OSC 72 drag and drop messages, support detection, and a runnable example.
  • Inline height changes and completed-row commits for streaming output.
  • Kitty OSC 66 text sizing and image placeholder primitives.
  • Extended cursor reports, UTF-8 C1 text handling, and reliable wake delivery.
  • A redesigned website with new guides, examples, and contributor documentation.

Both uncurses and uncurses-ratatui use version 0.0.8.
The adapter follows the core event changes.

Compatibility with v0.0.7

This release includes source and behavior changes.
Review event matches, ANSI token consumers, and stored numeric input values.

Clipboard and paste events

OSC 52 replies produce ClipboardStart { selection }, zero or more
ClipboardChunk(Vec<u8>) events, and ClipboardEnd { complete }.
Chunks contain raw wire bytes, normally base64. Applications decode the payload.
Chunk boundaries can split base64 groups.

PasteEnd { complete } also reports transfer completion.
A terminal terminator sets complete to true.
Idle recovery, explicit recovery, and input read failures produce incomplete
ends after retained payload bytes.

EventSource exposes clipboard and paste idle settings and explicit recovery.
The clipboard idle timeout defaults to two seconds.
Use with_clipboard_idle_timeout(None) to retain a reply across arbitrary delays.
end_clipboard() explicitly ends an incomplete reply.

Other control-string bodies remain intact across caller timeouts.
Their terminators or interrupting escape sequences determine their boundaries.

Cursor reports

Match Event::CursorPosition { position, page }.
position contains zero-based coordinates.
page contains the one-based DECXCPR page number, or zero when absent.

ANSI tokens

ansi::text::Token exposes kind, bytes, width, and control.
Match TokenKind for text, escape, and control categories.
The tokenizer recognizes 7-bit, raw C1, and UTF-8 C1 controls.
Text utilities preserve complete UTF-8 characters inside control strings.

Keyboard and mouse values

KeyModifiers follows Kitty ordering across CSI keyboard forms.
SUPER uses bit 0x08, and META uses bit 0x20.
Xterm's Meta bit therefore maps to SUPER.
Use named flags when constructing or comparing modifiers.
Review serialized numeric masks.

MouseButton::None has discriminant zero.
Review numeric casts and stored button values.

Windows input

EventSource starts with native console serialization on Windows.
Standalone callers use set_vt_input(true) when the console enables
ENABLE_VIRTUAL_TERMINAL_INPUT, including after Terminal::make_raw().
Program synchronizes this setting during initialization, pause, and resume.
The setting and its accessors are Windows-only.

Rendering and input reliability

tmux uses supported cursor sequences for long jumps.
tmux and GNU Screen use the portable tab reset even with inherited
outer-terminal variables, such as KITTY_WINDOW_ID.

Inline insertion accounts for wrapping, tabs, and the screen's width policy.
Screen::resize_height() adjusts inline height.
Screen::commit_rows() releases completed rows while preserving their output.
Partial writes retain unsent bytes for a later flush.

Ready input and resize events preserve pending wake notifications.
Async readers receive deadline changes and explicit transfer recovery.
Windows lifecycle operations coordinate with shared input readers.

Examples and reference

From a checkout of this release, run examples with
cargo run -p examples --example <name>.
Start with clipboard, drag_drop, inline_height, streaming,
sized_text_overlap, or wake.

See the installation guide,
input guides, and
v0.0.8 API reference.

Changelog

Breaking changes

  • Support extended cursor position reports
  • Expose token fields in a struct
  • Give MouseButton::None a zero discriminant
  • Use Kitty modifier ordering consistently (#126)
  • Remove automatic string idle timeouts (#129)
  • Make VT input configuration Windows-only (#131)
  • Stream clipboard replies with paste-style recovery (#132)

Bug Fixes

  • Track Windows VT input on the event source (#104)
  • Account for terminal wrapping in insert_above
  • Account for tabs in insert_above
  • Preserve rendered geometry during inline insertion
  • Establish inline height from empty geometry
  • Retain unsent bytes after partial writes
  • Normalize UTF-8 C1 controls in insert_above
  • Preserve UTF-8 in all control strings (#108)
  • Separate escape and string idle timeouts (#112)
  • Isolate async requirements and Unicode feature checks (#120)
  • Service ready input before wake notifications (#125)
  • Consume wakes with ready input and resize events (#128)
  • Preserve wakes after ready events (#130)
  • Disable CHT for tmux terminals (#142)
  • Reset tab stops safely inside multiplexers (#143)

Documentation

  • Limit insertion to styled text
  • List Win32 input mode support
  • Correct installation and terminal lifecycle examples (#117)
  • Map contributor workflows and agent context (#118)
  • Explain installation and revision compatibility (#119)
  • Define test quality rules (#134)

Features

  • Add text sizing and image placeholder primitives (#91)
  • Resize inline height without a full repaint
  • Commit completed inline rows
  • Recognize UTF-8 C1 controls
  • Support Kitty OSC 72 drag and drop (#107)
  • Redesign the site and documentation (#123)

Refactor

  • Use screen width policy during normalization
  • Remove unused single-cell touch helper (#121)
  • Share platform lifecycle implementations (#124)

Testing

  • Adapt row-commit rendered-size checks
  • Retain rendered geometry after empty row commits
  • Remove redundant normalization matrix
  • Remove redundant cases and repair ineffective checks (#133)