These docs describe the main branch, including unreleased changes. Read the 0.6.0 docs.

OpenTUI 0.5.9

npmGitHub release

Added

  • core: EditBuffer.getTabWidth() and EditBuffer.setTabWidth(width) read and change the tab width. Changing it keeps cursor positions and undo/redo history valid. See Editing buffers and views. (#1449)
  • native: Zig consumers can import the audio module from the opentui package. See Audio. (#1431)
  • native: opentui.yoga_c exposes the Yoga C API to Zig consumers. This export is unstable and can change or be removed without notice. See Yoga API. (#1454)
  • native: OTUI_GHOSTTY_LOG_LEVEL sets the level of Ghostty log messages that OpenTUI forwards to its logger. It accepts error or err, warn or warning, info, and debug. Without it, or with an invalid value, these messages are discarded. See Environment variables. (#1426)

Changed

  • core: Wrapped text layout uses less time and memory. On a 945 KB Unicode fixture, initial layout takes 6.5 ms instead of 11.3 ms. Appending text and measuring the wrapped result is about 5 times faster. OpenTUI now builds word-break metadata during the first wrapped layout, so this costs more memory for views that are never resized. The first resize alone is slightly slower on that fixture. See Text and terminal cells. (#1428, #1456)
  • core: Changing the tab width of text that has no tabs is now constant time. On a 1 MiB fixture, 40 changes took 211 ms before. See Editing buffers and views. (#1450)

Fixed

  • core: Wrapped text no longer splits CJK characters and emoji incorrectly or starts wrapped lines with extra whitespace. Graphemes that contain visible characters and whitespace are no longer dropped at wrap boundaries. See Text and terminal cells. (#1428, #1447)
  • core: Copying text that the renderer truncated with an ellipsis now copies the full source text. For example, ABCDEć„œ at width 4 copied ABC. See Text and terminal cells. (#1448)
  • core: Changing the tab width no longer leaves stale cached text metrics or moves cursors in live text and undo/redo history. See Editing buffers and views. (#1428, #1449)
  • core: Selection in EmbeddedTerminalRenderable highlights only the cells that contain text, not trailing cells and empty rows. A drag selects text only after the pointer leaves its starting cell. See Embedded terminal. (#1451)
  • core: Embedded terminals now encode arrow keys, Ctrl+C, and Escape correctly for programs that use the Kitty keyboard protocol. See Embedded terminal. (#1423)
  • core: Hit testing no longer misses the last row and column inside bordered containers, including scrollable, nested, and buffered ones. See Interaction, focus, and selection. (#1441)
  • core: A resize signal with unavailable terminal dimensions no longer resets the renderer to 80x24. See Renderer. (#1440)
  • core: A frame delayed by backpressure no longer restarts a continuous render loop that its callback paused or stopped. See Renderer. (#1170)
  • core: The renderer preserves updates to wide graphemes, and the vignette effect preserves grapheme runs. See Post-processing effects. (#1424)
  • native: Zig standard-library logs, such as those from Ghostty, no longer write to the host terminal and corrupt the display. They are discarded by default. See Environment variables. (#1425)

API changes#

@opentui/core#

Added

  • method EditBuffer.getTabWidth(): number
  • method EditBuffer.setTabWidth(width: number): void
  • property RenderLib.editBufferSetTabWidth: (buffer: EditBufferHandle, width: number) => void