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

OpenTUI 0.5.7

npmGitHub release

Added

  • core: Double-click selects a word and triple-click selects a line. A second press on the same cell within 500 ms selects a word, and a third selects a line. A single click still selects nothing. Dragging after a word click keeps the spaces between words. Shift+arrow after a multi-click extends by cell. ASCIIFont and tables stay cell-only. The click interval and word-character set are fixed. SelectionBehavior ("cell" | "word" | "line") is accepted as an optional behavior argument by CliRenderer.startSelection(), RenderContext.startSelection, the Selection constructor, TextBufferView.setLocalSelection(), TextBufferView.updateLocalSelection(), EditorView.setLocalSelection() and EditorView.updateLocalSelection(). Selection.behavior and LocalSelectionBounds.behavior expose it. See Interaction, focus, and selection. (#1407)
  • core: Selection occupancy is configurable with SelectionOccupancy ("cell" | "boundary"). "cell" includes both endpoint graphemes, as in Vim. "boundary" selects a half-open range between insertion points, as with a thin cursor. Set it with the selectionOccupancy option on EditBufferOptions and EditBufferRenderable. Read and write it with TextBufferView.getSelectionOccupancy(), TextBufferView.setSelectionOccupancy(), EditorView.getSelectionOccupancy() and EditorView.setSelectionOccupancy(). EditorView also adds convertSelectionToCell(), gotoVisualLineEnd(), setSelectionColors() and setSelectionInclusive(). See Textarea and Interaction, focus, and selection. (#1393)

Changed

  • core: Selection endpoints are normalized to whole graphemes. Highlighting, copied text, deletion, cursor sync and wrapped-line navigation now agree in both directions. Extending a selection by one display column no longer splits a wide grapheme. A press without movement keeps the selection empty. A cursor at the end of a line does not select the newline, but crossing the line boundary does. See Interaction, focus, and selection. (#1393)

Fixed

  • core: A selection no longer flips when x is left of the text and y is below it. See Interaction, focus, and selection. (#1381)
  • core: Forced Sixel output is rejected unless the detected host supports Sixel. Apple Terminal and terminal multiplexers now fall back to blocks. See Terminal capabilities. (#1387)
  • core: OSC 66 probe responses are matched to their requests. See Terminal capabilities. (#1384)
  • core: Split-footer commits on Darwin ARM64 no longer lose frame-finalization state. Native boolean flags are passed as numeric bytes, so Bun and Node share one FFI contract. Cell attributes are tested as u32 on all platforms under Node. See Runtime and platform support. (#1409, #1411)
  • core: Node.js releases later than 26.4.0 are supported. 26.4.0 remains the minimum. See Runtime and platform support. (#1410)

API changes#

@opentui/core#

Added

  • method EditorView.convertSelectionToCell(): boolean
  • method EditorView.getSelectionOccupancy(): SelectionOccupancy
  • method EditorView.gotoVisualLineEnd(): void
  • method EditorView.setSelectionColors(bgColor?: RGBA, fgColor?: RGBA): void
  • method EditorView.setSelectionInclusive(start: number, end: number, bgColor?: RGBA, fgColor?: RGBA): void
  • method EditorView.setSelectionOccupancy(occupancy: SelectionOccupancy): void
  • method TextBufferView.getSelectionOccupancy(): SelectionOccupancy
  • method TextBufferView.setSelectionOccupancy(occupancy: SelectionOccupancy): void
  • property EditBufferOptions.selectionOccupancy?: SelectionOccupancy
  • property EditBufferRenderable.selectionOccupancy: SelectionOccupancy
  • property LocalSelectionBounds.behavior: SelectionBehavior
  • property RenderLib.editorViewConvertSelectionToCell: (view: EditorViewHandle) => boolean
  • property RenderLib.editorViewGotoVisualLineEnd: (view: EditorViewHandle) => void
  • property RenderLib.editorViewSetSelectionColors: (view: EditorViewHandle, bgColor: RGBA | null, fgColor: RGBA | null) => void
  • property RenderLib.editorViewSetSelectionInclusive: (view: EditorViewHandle, start: number, end: number, bgColor: RGBA | null, fgColor: RGBA | null) => void
  • property RenderLib.editorViewSetSelectionOccupancy: (view: EditorViewHandle, occupancy: SelectionOccupancy) => void
  • property RenderLib.textBufferViewGetSelectionOccupancy: (view: TextBufferViewHandle) => SelectionOccupancy
  • property RenderLib.textBufferViewSetSelectionOccupancy: (view: TextBufferViewHandle, occupancy: SelectionOccupancy) => void
  • property Selection.behavior: SelectionBehavior
  • type SelectionBehavior = "cell" | "word" | "line"
  • type SelectionOccupancy = "cell" | "boundary"

Changed

  • constructor Selection(anchorRenderable: Renderable, anchor: { x: number; y: number; }, focus: { x: number; y: number; })constructor Selection(anchorRenderable: Renderable, anchor: { x: number; y: number; }, focus: { x: number; y: number; }, behavior?: SelectionBehavior)
  • method CliRenderer.startSelection(renderable: Renderable, x: number, y: number): voidmethod CliRenderer.startSelection(renderable: Renderable, x: number, y: number, behavior?: SelectionBehavior): void
  • method EditorView.setLocalSelection(anchorX: number, anchorY: number, focusX: number, focusY: number, bgColor?: RGBA, fgColor?: RGBA, updateCursor?: boolean, followCursor?: boolean): booleanmethod EditorView.setLocalSelection(anchorX: number, anchorY: number, focusX: number, focusY: number, bgColor?: RGBA, fgColor?: RGBA, updateCursor?: boolean, followCursor?: boolean, behavior?: SelectionBehavior): boolean
  • method EditorView.updateLocalSelection(anchorX: number, anchorY: number, focusX: number, focusY: number, bgColor?: RGBA, fgColor?: RGBA, updateCursor?: boolean, followCursor?: boolean): booleanmethod EditorView.updateLocalSelection(anchorX: number, anchorY: number, focusX: number, focusY: number, bgColor?: RGBA, fgColor?: RGBA, updateCursor?: boolean, followCursor?: boolean, behavior?: SelectionBehavior): boolean
  • method TextBufferView.setLocalSelection(anchorX: number, anchorY: number, focusX: number, focusY: number, bgColor?: RGBA, fgColor?: RGBA): booleanmethod TextBufferView.setLocalSelection(anchorX: number, anchorY: number, focusX: number, focusY: number, bgColor?: RGBA, fgColor?: RGBA, behavior?: SelectionBehavior): boolean
  • method TextBufferView.updateLocalSelection(anchorX: number, anchorY: number, focusX: number, focusY: number, bgColor?: RGBA, fgColor?: RGBA): booleanmethod TextBufferView.updateLocalSelection(anchorX: number, anchorY: number, focusX: number, focusY: number, bgColor?: RGBA, fgColor?: RGBA, behavior?: SelectionBehavior): boolean
  • property RenderContext.startSelection: (renderable: Renderable, x: number, y: number) => voidproperty RenderContext.startSelection: (renderable: Renderable, x: number, y: number, behavior?: SelectionBehavior) => void
  • property RenderLib.editorViewSetLocalSelection: (view: EditorViewHandle, anchorX: number, anchorY: number, focusX: number, focusY: number, bgColor: RGBA | null, fgColor: RGBA | null, updateCursor: boolean, followCursor: boolean) => booleanproperty RenderLib.editorViewSetLocalSelection: (view: EditorViewHandle, anchorX: number, anchorY: number, focusX: number, focusY: number, bgColor: RGBA | null, fgColor: RGBA | null, updateCursor: boolean, followCursor: boolean, behavior?: SelectionBehavior) => boolean
  • property RenderLib.editorViewUpdateLocalSelection: (view: EditorViewHandle, anchorX: number, anchorY: number, focusX: number, focusY: number, bgColor: RGBA | null, fgColor: RGBA | null, updateCursor: boolean, followCursor: boolean) => booleanproperty RenderLib.editorViewUpdateLocalSelection: (view: EditorViewHandle, anchorX: number, anchorY: number, focusX: number, focusY: number, bgColor: RGBA | null, fgColor: RGBA | null, updateCursor: boolean, followCursor: boolean, behavior?: SelectionBehavior) => boolean
  • property RenderLib.textBufferViewSetLocalSelection: (view: TextBufferViewHandle, anchorX: number, anchorY: number, focusX: number, focusY: number, bgColor: RGBA | null, fgColor: RGBA | null) => booleanproperty RenderLib.textBufferViewSetLocalSelection: (view: TextBufferViewHandle, anchorX: number, anchorY: number, focusX: number, focusY: number, bgColor: RGBA | null, fgColor: RGBA | null, behavior?: SelectionBehavior) => boolean
  • property RenderLib.textBufferViewUpdateLocalSelection: (view: TextBufferViewHandle, anchorX: number, anchorY: number, focusX: number, focusY: number, bgColor: RGBA | null, fgColor: RGBA | null) => booleanproperty RenderLib.textBufferViewUpdateLocalSelection: (view: TextBufferViewHandle, anchorX: number, anchorY: number, focusX: number, focusY: number, bgColor: RGBA | null, fgColor: RGBA | null, behavior?: SelectionBehavior) => boolean