celina

Search:
Group by:

Celina - A CLI library for Nim inspired by Ratatui.

A powerful Terminal User Interface library for Nim, inspired by Ratatui. Provides high-performance, type-safe components for building interactive terminal applications with both synchronous and asynchronous support.

Basic Usage:

import pkg/celina

proc main() =
  var app = newApp()
  app.run()

Async Usage (requires -d:asyncBackend=asyncdispatch or -d:asyncBackend=chronos):

import pkg/celina

proc main() {.async.} =
  var app = newAsyncApp()
  await app.runAsync()

Modules

Core

  • app — Application lifecycle and event loop
  • buffer — Screen buffer for managing terminal content
  • colors — Color and style definitions
  • cursor — Cursor control and state management
  • errors — Error types
  • events — Keyboard and mouse event handling
  • fps — Frame rate monitoring
  • geometry — Geometric types for positioning and sizing
  • layout — Constraint-based layout system
  • renderer — Differential rendering and terminal output
  • resources — Resource management and RAII patterns
  • terminal — Terminal control using ANSI escape sequences
  • terminal_common — Shared terminal algorithms and utilities
  • windows — Window management with overlapping and focus support

Async

  • async_backend — Async backend configuration (asyncdispatch/chronos)
  • async_app — Async application framework and event loop
  • async_buffer — Async-safe buffer implementation
  • async_events — Async keyboard and mouse event handling
  • async_terminal — Async terminal I/O interface

Widgets

  • base — Base widget traits and types
  • button — Interactive button widget
  • input — Text input widget with cursor and selection
  • list — List widget with scrolling and selection
  • progress — Progress bar widget
  • table — Table widget for structured data
  • tabs — Tabbed interface widget
  • text — Text rendering widget with alignment and styling

Exports

Position, size, position, isValid, isValid, Rect, size, shrink, contains, union, contains, $, $, center, Area, isEmpty, rect, Size, -, rect, $, pos, VAlign, area, area, expand, shrink, intersects, bottom, +, intersection, right, HAlign, indigo, color256, grayscale, toAnsiCode, ==, withModifiers, $, Style, defaultStyle, $, deepSkyBlue, hotPink, toAnsiCode, bold, color256, reversed, hsv, ansiToRgb, rgb, hsvToRgb, toRgb, ColorValue, withBg, style, ==, withFg, brightColors, Color, default, color, salmon, teal, addModifier, italic, ColorKind, violet, cubeColor, toAnsiSequence, RgbColor, crimson, limeGreen, withBg, $, style, ansi256ToRgb, ==, defaultColor, orange, lerp, underline, toAnsiCode, withFg, rgb, darkColors, resetSequence, gold, toBgAnsiCode, lerp, StyleModifier, rgb, toAnsiCode, removeModifier, pastels, []=, getDirtyRegionSize, setString, width, clone, Buffer, ==, $, cell, [], runeWidth, cell, cell, setCell, $, markDirty, setString, resize, markDirtyRect, setCell, clear, []=, isEmpty, isValidPos, DirtyRegion, clearDirty, setCell, isDirty, setCell, ==, setString, setRunes, diff, setString, isValidPos, merge, runesWidth, fill, merge, newBuffer, Cell, toStrings, getCell, setRunes, setString, newBuffer, [], readKeyInput, readKey, truncateUtf8, Utf8ValidationResult, MouseEventKind, KeyCode, $, buildUtf8String, validateUtf8Sequence, KeyModifier, incrementResizeCounter, $, waitForKey, initSignalHandling, $, waitForAnyKey, pollEvents, Event, MouseButton, KeyEvent, utf8CharLength, pollKey, MouseEvent, getResizeCounter, hasInput, utf8ByteLength, isUtf8ContinuationByte, EventKind, min, twoColumnPercent, withMargins, fill, percentage, Constraint, evenSplit, LayoutSolver, withMargin, Layout, length, layout, vertical, max, threeRow, twoColumn, ConstraintKind, $, split, Direction, ratio, horizontal, $, render, setCursorPosition, setCursorStyle, setTitleOnly, withTerminal, cleanup, setupWithMouseAndPaste, suspend, saveCursor, setupWithMouse, enableRawMode, showCursor, disableAlternateScreen, getSize, disableFocusEvents, clearToEndOfLine, clearLine, resume, clearScreen, TerminalError, updateSize, draw, renderCell, restoreCursor, hideCursor, clearToStartOfLine, disableBracketedPaste, getTerminalSize, Terminal, setIconName, drawWithCursor, withTerminal, moveCursorRight, moveCursorUp, moveCursorLeft, enableFocusEvents, isSuspended, setCursorPosition, disableMouse, setup, enableAlternateScreen, moveCursorDown, disableRawMode, enableBracketedPaste, disableSyncOutput, setupWithPaste, renderFull, enableSyncOutput, setWindowTitle, getTerminalSizeOrDefault, enableMouse, newTerminal, setupWithHiddenCursor, moveCursor, EventError, tryRecover, ensureNotNil, newTerminalError, newLayoutError, checkSystemCall, checkSystemCallVoid, newRenderError, TerminalError, ensure, newEventError, tryIO, RenderError, LayoutError, newBufferError, withResource, withErrorContext, withContext, BufferError, debugLog, checkForLeaks, getStats, ResourceId, ==, getGlobalResourceManager, acquire, newResourceGuard, initGlobalResourceManager, isValid, withManagedResource, newResourceManager, $, ResourceType, release, withResourceGuard, touchResource, globalResourceManager, release, ResourceState, getResourceInfo, getResourceStats, clear, ResourceGuard, cleanupAllResources, hash, ResourceManager, ResourceInfo, unregisterResource, get, newResourcePool, registerResource, cleanupLeakedResources, getAllResources, ResourcePool, CursorUpSeq, applyTerminalConfig, HideCursorSeq, enableFocusEventsImpl, disableBracketedPasteImpl, generateRenderBatch, getTerminalCapabilities, Osc8End, CursorRightSeq, CursorStyle, getSize, makeTitleOnlySeq, enableSyncOutputImpl, ShowCursorSeq, supportsAnsi, OscTitleOnlyStart, getTerminalSizeFromSystem, AlternateScreenExit, BracketedPasteEnable, clearLastBufferForResume, MouseMode, BracketedPasteDisable, calculateRenderMetrics, CursorLeftSeq, isTerminalInteractive, CursorState, makeWindowTitleSeq, RenderCommandKind, SyncOutputEnable, buildOutputWithCursor, optimizeRenderBatch, enableAlternateScreenImpl, buildOutputString, SaveCursorSeq, disableMouseImpl, getArea, SyncOutputDisable, enableBracketedPasteImpl, OscIconNameStart, Osc8Start, buildDifferentialOutput, OscWindowTitleStart, calculateSimpleDiff, RenderBatch, ClearScreenSeq, buildFullRenderOutput, AlternateScreenEnter, enableMouseMode, FocusEventsDisable, Osc8Reset, makeCursorPositionSeq, CursorStyleBlinkingUnderline, getRawModeConfig, ClearToEndOfLineSeq, OscTerminator, disableMouseMode, CursorStyleBlinkingBlock, makeCursorPositionSeq, disableFocusEventsImpl, ClearToStartOfLineSeq, MouseSequences, isAlternateScreen, isRawMode, AnsiSequence, TerminalConfig, CursorStyleSteadyUnderline, enableMouseImpl, writeAndFlush, makeIconNameSeq, FocusEventsEnable, SuspendState, CursorStyleSteadyBlock, saveSuspendState, disableSyncOutputImpl, wrapWithSyncOutput, parseMouseEvent, disableAlternateScreenImpl, makeHyperlinkStartSeq, RenderMetrics, CursorStyleDefault, CursorStyleSteadyBar, RestoreCursorSeq, CursorStyleBlinkingBar, CursorDownSeq, makeCursorMoveSeq, isMouseEnabled, isSuspended, addCommand, restoreSuspendedFeatures, RenderCommand, getTerminalSizeWithFallback, getCursorStyleSeq, ClearLineSeq, getWindow, setCursorStyle, getConfig, withBracketedPaste, setTargetFps, getWindowCount, getCursorStyle, App, getBufferContent, suspend, celinaVersion, showCursor, $, $, enableWindowMode, getTargetFps, resume, getWindowInfo, onTimeout, focusWindow, getFocusedWindowId, resetCursor, getBuffer, getCurrentFps, setCursorPosition, getBufferCell, withMouseCapture, withAlternateScreen, withRawMode, withWindowMode, removeWindow, getWindows, getTerminalSize, isSuspended, showCursorAt, isCursorVisible, newApp, getLastFrameTime, defaultAppConfig, getFocusedWindow, setApplicationTimeout, onEvent, getFrameCount, setCursorPosition, disableMouse, showCursorAt, DefaultAppConfig, onEvent, quickRun, AppConfig, onTick, getApplicationTimeout, run, handleWindowEvent, moveCursorBy, withTitle, withFocusEvents, quit, hideCursor, onRender, enableMouse, addWindow, isRunning, getCursorPosition, onTick, withTargetFps, withSuspend, celina/core/config, Renderer, render, showCursorAt, clear, setCursorPosition, renderDiff, getCursorManager, isCursorVisible, forceRender, showCursorAt, getBuffer, hideCursor, resize, newRenderer, setString, resize, getCursorPosition, setCursorPosition, showCursor, setCursorStyle, newCursorManager, isVisible, setPosition, styleChanged, hide, setStyle, updateLastStyle, setLastStyle, CursorState, CursorManager, reset, showAt, setPosition, show, getStyle, getState, hasPosition, getPosition, getRemainingFrameTime, getTargetFps, getFrameTimeout, endFrame, setTargetFps, getStats, newFpsMonitor, shouldRender, getCurrentFps, FpsMonitor, startFrame, PerfStats, WindowState, render, WindowEvent, render, setBorder, defaultBorder, move, WindowKeyHandler, ==, getVisibleWindows, Window, defaultBorderChars, dispatchEvent, setKeyHandler, stopPropagation, WindowBorder, hide, $, $, getContentBuffer, WindowManager, $, bringToFront, handleEvent, focusWindow, findWindowAt, addWindow, newWindow, getWindow, setResizeHandler, resize, restore, WindowInfo, sendToBack, removeWindow, setArea, setEventHandler, setTitle, EventHandler, WindowMouseHandler, maximize, show, dispatchResize, WindowId, preventDefault, clearEventHandlers, minimize, toWindowInfo, WindowEventHandler, handleWindowEvent, newWindowManager, BorderChars, setMouseHandler, getContentSize, getFocusedWindow, WindowResizeHandler, EventPhase, registerFD, asyncBackend, sleepMs, hasChronos, unregisterFD, hasAsyncDispatch, hasAsyncSupport, hasAsyncSupport, hasChronos, hasAsyncDispatch, getWindow, setCursorStyle, getConfig, withBracketedPaste, setTargetFps, restoreTerminal, AsyncAppError, getCursorStyle, showCursorAt, getBufferContent, resumeAsync, celinaVersion, showCursor, $, $, newAsyncApp, enableWindowMode, AsyncApp, getTargetFps, moveCursorBy, focusWindow, getFocusedWindowId, getFrameCount, onEventAsync, addWindow, getBuffer, getCurrentFps, setCursorPosition, onEventAsync, getBufferCell, withMouseCapture, hideCursor, withRawMode, withWindowMode, removeWindow, getWindows, getTerminalSize, isSuspended, onTickAsync, isCursorVisible, getLastFrameTime, defaultAppConfig, getWindowCount, setApplicationTimeout, getWindowInfo, onTimeoutAsync, onTickAsync, setCursorPosition, disableMouse, showCursorAt, DefaultAppConfig, suspendAsync, getCursorPosition, runAsync, withSuspendAsync, quickRunAsync, withFocusEvents, getApplicationTimeout, handleWindowEvent, withTitle, resetCursor, quit, withAlternateScreen, enableMouse, getFocusedWindow, isRunning, onRenderAsync, AppConfig, withTargetFps, celina/core/config, setupWithPasteAsync, suspendAsync, moveCursorUpAsync, setWindowTitleAsync, setupWithHiddenCursorAsync, moveCursorRightAsync, clearToStartOfLineAsync, enableFocusEvents, showCursorAtAsync, disableAlternateScreen, disableFocusEvents, setCursorStyleAsync, newAsyncTerminal, setupWithMouseAsync, getSize, enableSyncOutput, restoreCursorAsync, hideCursorAsync, disableBracketedPaste, updateSize, clearToEndOfLineAsync, enableBracketedPaste, moveCursorAsync, clearLineAsync, showCursorAsync, setCursorPositionAsync, renderAsync, drawWithCursorAsync, enableAlternateScreen, enableMouse, moveCursorDownAsync, AsyncTerminalError, drawAsync, isSuspended, getTerminalSizeAsync, withAsyncTerminal, disableMouse, setTitleOnlyAsync, enableRawMode, renderCellAsync, disableRawMode, disableSyncOutput, setIconNameAsync, clearScreenAsync, setupWithMouseAndPasteAsync, resumeAsync, showCursorAtAsync, moveCursorLeftAsync, saveCursorAsync, AsyncTerminal, setCursorPositionAsync, setupAsync, drawAsync, cleanupAsync, getArea, renderFullAsync, underline, setString, color256, bold, isValid, setRunesAsync, updateFromBuffer, toAnsiCode, mergeAsync, rgb, ==, contains, center, ==, setCell, newBuffer, AsyncBufferPool, defaultStyle, $, cell, -, setCell, newAsyncBufferPool, VAlign, toAnsiCode, area, withAsyncBuffer, resizeAsync, intersection, HAlign, AsyncBufferMetrics, hsv, ansiToRgb, clear, isValidPos, isEmpty, hsvToRgb, DirtyRegion, newAsyncBuffer, Buffer, withBg, isDirty, Size, ==, $, diff, newAsyncBufferNoRM, color, default, updateFromBufferAsync, rgb, merge, ==, newBuffer, cell, bottom, ansi256ToRgb, stats, getDirtyRegionSize, width, violet, toAnsiSequence, getDirtyRegionSize, withBufferAsync, setRunes, crimson, $, clearAsync, right, getAsyncBufferMetrics, style, AsyncBuffer, size, getCell, clear, italic, returnBuffer, $, orange, setString, trackAsyncBufferDestroy, setCellAsync, setRunes, $, Cell, []=, toAnsiCode, setStringAsync, setCell, setCell, ColorKind, globalAsyncBufferMetrics, darkColors, newAsyncBufferNoRM, merge, resetSequence, withBuffer, gold, RgbColor, $, toBgAnsiCode, toStrings, setCellAsync, StyleModifier, intersects, toAnsiCode, pastels, [], [], Position, indigo, withFg, position, clone, diffAsync, clone, isEmpty, clearDirty, withModifiers, shrink, toBufferAsync, $, destroyAsync, Area, runeWidth, getSize, deepSkyBlue, hotPink, markDirty, grayscale, color256, setRunesAsync, resize, Style, markDirtyRect, newAsyncBuffer, size, Color, teal, fillAsync, toRgb, ColorValue, toBuffer, style, lerp, setString, setRunes, union, withFg, isValidPos, brightColors, pos, fill, expand, shrink, salmon, setRunes, addModifier, getArea, setString, cubeColor, Rect, setString, limeGreen, isValid, contains, withBg, $, isDirty, reversed, destroyAsyncBufferPool, ==, area, getBuffer, defaultColor, +, getCell, $, setStringAsync, clearDirty, cell, rgb, setString, []=, rect, runesWidth, clearDirtyAsync, rect, lerp, toStringsAsync, getCell, removeModifier, setString, trackAsyncBufferCreation, waitForKeyAsync, initAsyncEventSystem, AsyncEventError, readKeyAsync, AsyncEventStream, pollEventsAsync, getResizeCounter, pollKeyAsync, stopAsync, newAsyncEventStream, startAsync, waitForAnyKeyAsync, incrementResizeCounter, cleanupAsyncEventSystem