OpenTUI 0.5.12

npmGitHub release

Added

  • core: textAlign aligns each line of a text renderable to "left", "center", or "right". It works with wrapMode set to "char" or "word". Alignment applies after wrapping. TextBufferView.setTextAlign() sets it on a view. See Text. (#1507)
  • core: MousePointerStyle accepts the full set of CSS cursor names, such as "grab", "wait", "help", and "col-resize". Terminals differ in which OSC 22 pointer styles they support. See Interaction, focus, and selection. (#1037)
  • core: EmbeddedTerminalRenderable has a transparentBackground option, false by default. When it is true, cells with no explicit background use the host terminal background. Cells with an explicit background stay opaque. You can change it after creation. See Embedded terminal. (#1502)
  • core: EditorView.isDestroyed reports whether the view has been destroyed. See Editing buffers and views. (#1504)
  • core: TextTableRenderable has an fg property that sets the text color of existing cells. See TextTable. (#1503)

Fixed

  • core: MarkdownRenderable passes its fg to tables. Table text no longer always uses the #FFFFFF default, and a later change to fg recolors existing tables. See Markdown. (#1503)
  • core: Reading the cursor of a destroyed editor returns an empty cursor. Listeners that run during destruction no longer throw. See Editing buffers and views. (#1504)
  • core: Shrinking the width of a split footer no longer leaves stale rows on screen. Cleanup now starts at the visible footer origin. See Renderer. (#1488)
  • core: A scrollback snapshot that starts in the middle of a line stays aligned with the text already written before it. Rendering and hit testing now use the same cells. See Text and terminal cells. (#1511)
  • core: A worker error that arrives while the worker is terminating no longer becomes an uncaught exception in Node. See Lifecycle and cleanup. (#1508)

API changes#

@opentui/core#

Added

  • method TextBufferView.setTextAlign(alignment: "left" | "center" | "right"): void
  • readonly property EditorView.isDestroyed: boolean
  • property EmbeddedTerminalOptions.transparentBackground?: boolean
  • property EmbeddedTerminalRenderable.transparentBackground: boolean
  • property RenderLib.embeddedTerminalSetTransparentBackground: (handle: EmbeddedTerminalHandle, transparent: boolean) => void
  • property RenderLib.textBufferViewSetTextAlign: (view: TextBufferViewHandle, alignment: "left" | "center" | "right") => void
  • property TextBufferOptions.textAlign?: "left" | "center" | "right"
  • protected property TextBufferRenderable._textAlign: "left" | "center" | "right"
  • property TextBufferRenderable.textAlign: "left" | "center" | "right"
  • property TextTableRenderable.fg: RGBA

Changed

  • protected property TextBufferRenderable._defaultOptions: { fg: RGBA; bg: RGBA; selectionBg: undefined; selectionFg: undefined; selectable: true; attributes: number; wrapMode: "none" | "char" | "word"; tabIndicator: undefined; tabIndicatorColor: undefined; truncate: false; }protected property TextBufferRenderable._defaultOptions: { fg: RGBA; bg: RGBA; selectionBg: undefined; selectionFg: undefined; selectable: true; attributes: number; wrapMode: "none" | "char" | "word"; textAlign: "left" | "center" | "right"; tabIndicator: undefined; tabIndicatorColor: undefined; truncate: false; }
  • type MousePointerStyle = "default" | "pointer" | "text" | "crosshair" | "move" | "not-allowed"type MousePointerStyle = "auto" | "default" | "none" | "context-menu" | "help" | "pointer" | "progress" | "wait" | "cell" | "crosshair" | "text" | "vertical-text" | "alias" | "copy" | "move" | "no-drop" | "not-allowed" | "grab" | "grabbing" | "all-scroll" | "col-resize" | "row-resize" | "n-resize" | "e-resize" | "s-resize" | "w-resize" | "ne-resize" | "nw-resize" | "se-resize" | "sw-resize" | "ew-resize" | "ns-resize" | "nesw-resize" | "nwse-resize" | "zoom-in" | "zoom-out"