~/dev/terminus — zsh — 192×54 v1.0.0 · MIT

A React-inspired TUI framework for Java 21

jdk 21 zero runtime deps 60 fps MIT github.com/P0intMaN/terminus
~/dev/terminus 02 / 11
// what_is_terminus

A zero-dependency TUI framework
that brings the component model
from React and Flutter to the terminal.

Components.
Layouts. State.
Raw mode.
ANSI. Input.
Diff rendering.
Zero flicker.
60 fps.
Virtual threads.
terminus 02 / 11
~/dev/terminus/examples · App.java 03 / 11
// hello_world

A complete TUI app
in ~10 lines.

// imports omitted
public class App {
  public static void main(String[] args) {
    Layout root = Layout.column().padding(1).build();

    root.add(Text.bold("My App", 0x7F77DD));
    root.addFlex(Table.builder(model, columns).build());
    root.add(statusBar);

    TerminusApp.run(root);
  }
}
terminus 03 / 11
// in_action

A live process monitor.
Virtual scrolling · sortable columns · key-driven.

terminus-demo
./run-demo.sh
Terminus process monitor demo
terminus 04 / 11
~/io/terminus/core/components 05 / 11
// the_component_model

Everything is a Component.

Component (abstract)
├── Leaf          // renders directly
│   ├── Text
│   ├── ProgressBar
│   ├── TextInput
│   ├── Table
│   └── [your component]
└── Container
    └── Layout (row | column)
        └── gap · padding · flex

Text

Wrap, align, truncate, color. The atom.

ProgressBar

Four styles — eighths, block, ASCII, braille.

TextInput

Cursor, history, selection, kill rings.

Table

100k+ rows. Virtual scroll. Sortable.

terminus 05 / 11
// progress_bars

Four bar styles, one component.
Eighths · Block · ASCII · Braille.

ProgressBarExample
~60 fps · animated
Terminus progress bars and text fields
terminus 06 / 11
~/components/Table.java 07 / 11
// virtual_scrolling

100,000 rows.
Render only what's visible.

100k+
rows supported
O(v)
visible-only render
  • Typed model, per-column extractors
  • Numeric & lexical sort, multi-cycle
  • Flex + fixed columns, alignment
  • Selection callback, focus state
↑ ↓move selection
Home / Endfirst / last row
PgUp / PgDnscroll by page
scycle sort column
Sreverse sort direction
rreset to original order
Enterfire onSelect callback
terminus 07 / 11
~/architecture 08 / 11
// architecture

stdin events diff ANSI.

01 · ingest

EventLoop

  • stdin reader on a virtual thread
  • BlockingQueue<Event>
  • UI thread drains and dispatches
  • Sealed: Key · Mouse · Resize · State

02 · dispatch

EventDispatcher

  • Chain of Responsibility
  • Bubbles up the focus path
  • focused → parent → root
  • onEvent() mutates state, never UI

03 · render

RenderPipeline

  • LayoutEngine measures + places
  • Renderer walks the tree
  • ScreenDiffer computes deltas
  • AnsiWriter — atomic flush
// The golden rule — render() is pure. State mutations live in onEvent(). Unidirectional data flow.
terminus 08 / 11
~/patterns 09 / 11
// design_patterns

Built on 13 classic patterns.

PATTERNWHERE
CompositeComponent / Container / Leaf
VisitorRenderer walking the tree
Chain of Resp.EventDispatcher
ObservermarkDirty() bubbling
BuilderEvery component
Template MethodLayoutEngine
StrategyFlexConfig, TableModel
PATTERNWHERE
CommandEvent sealed hierarchy
Double BufferScreenBuffer
RepositoryTableModel
FacadeTerminusApp, RenderPipeline
State MachineKeyParser
Value ObjectCell, Bounds, Constraint
terminus 09 / 11
~/ROADMAP.md 10 / 11
// roadmap

What's next.

·ScrollView — scrollable content pane
·Tree — expandable tree view
·Modal — overlay with focus trap
·Sparkline — inline mini-chart
·Mouse click routing to components
·Terminal resize live reflow
·macOS support (termios layout)
·GraalVM native-image
PRs welcome — open an issue first, add tests, keep terminus-core dependency-free. Open an issue →
terminus 10 / 11
~/install 11 / 11
// install

Get started.

dependencies {
  implementation 'io.terminus:terminus-core:1.0.0'
}
<dependency>
  <groupId>io.terminus</groupId>
  <artifactId>terminus-core</artifactId>
  <version>1.0.0</version>
</dependency>
$ git clone https://github.com/P0intMaN/terminus.git
$ cd terminus
$ ./gradlew :terminus-demo:shadowJar
$ ./run-demo.sh   # a real terminal — not via gradle
github.com/P0intMaN/terminus
Built with Java 21 · Inspired by Bubble Tea · MIT
terminus 11 / 11