From 0eab292eb4575d8aaa8837f141de0eb42ebd7cc7 Mon Sep 17 00:00:00 2001 From: igarbayo Date: Mon, 16 Mar 2026 23:41:47 +0100 Subject: [PATCH 01/15] feat: add interactive REPL for manual testing --- README.md | 39 +- build.gradle | 9 + docs/manual-testing-guide.md | 314 ++++++++++++++++ gradle.properties | 2 + src/main/java/com/terminal/buffer/Main.java | 351 ++++++++++++++++++ .../com/terminal/buffer/TerminalBuffer.java | 12 +- 6 files changed, 719 insertions(+), 8 deletions(-) create mode 100644 docs/manual-testing-guide.md create mode 100644 gradle.properties create mode 100644 src/main/java/com/terminal/buffer/Main.java diff --git a/README.md b/README.md index ef06081..5efce1d 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,43 @@ A terminal text buffer implementation in Java — the core data structure used b Requires Java 8+. No external libraries except JUnit 5 for testing. +## Interactive REPL + +A command-line REPL is included to test the buffer manually: + +```bash +./gradlew run --console=plain -q +``` + +Type `help` inside the REPL to list all commands, or see the table below: + +| Command | Description | +|---|---| +| `write ` | Write text at cursor position (overwrite) | +| `insert ` | Insert text at cursor, shifting content right | +| `fill [char]` | Fill current line with character (space if omitted) | +| `newline` | Insert empty line at bottom, scroll top to scrollback | +| `clear` | Clear screen and reset cursor to (0, 0) | +| `clearall` | Clear screen, scrollback, and reset cursor | +| `cursor ` | Move cursor to position | +| `move up\|down\|left\|right [n]` | Move cursor N steps (default 1) | +| `fg ` | Set foreground color | +| `bg ` | Set background color | +| `bold` / `italic` / `underline` | Enable text style | +| `nostyle