Commit Graph

12 Commits

Author SHA1 Message Date
4e0b825fcc v1.2.0: remove spurious \n from draw-rect
draw-rect wrote \n after each row's fill, including the last row at
the bottom of the frame. This caused a terminal scroll, shifting all
content up by 1 and leaving the last row blank (terminal default bg).
cursor-move-escape at the start of each iteration already repositions
the cursor — the \n was never needed.
2026-05-20 09:57:49 -04:00
af572d5a8c v0.8.0: tangle to XDG (~/.local/share/cl-tty/), remove stale memex .lisp files 2026-05-18 13:04:10 -04:00
de1864bd94 fix: backend-size returns both cols and rows via multi-value-bind (or discards secondary values)
The OR pattern inside backend-size used (or (multiple-value-bind ...)
...), but multiple-value-bind only returns the primary value of its
body. When the env-var shortcut was removed, both calls to backend-size
(the cols nth-value 0 and rows nth-value 1) returned the same primary
value, making rows always nil.

Restructure with nested multiple-value-bind/values chains so both
return values propagate correctly through all fallback stages.
Also remove MY_TERM_COLS/ROWS env-var pre-check — it returned stale
startup dimensions after terminal resize.
2026-05-15 08:51:13 -04:00
bb579be207 fix: remove per-call finish-output from backend-write (flush once per frame via end-sync)
backend-write flushed output after every single draw-text/draw-rect
call, causing hundreds of individual flushes per frame. This caused
visible flicker on slow terminals.

Remove finish-output from backend-write — all critical flush points
(initialize-backend, shutdown-backend, enable-mouse, enable-bracketed-paste,
end-sync) already call finish-output explicitly.

DECICM sync (begin-sync/end-sync) wraps every frame boundary,
making the frame render atomically with a single flush at end-sync.
2026-05-14 19:36:21 -04:00
916f473107 docs: sync .org with implementation for backend-size, read-raw-byte, SIGWINCH
backend-protocol.org / simple.lisp:
- Replace hard-coded 80x24 prose with full 5-step fallback chain
  (MY_TERM env vars → ioctl fd 0 → ioctl stdout → /dev/tty → 80x24)
- Document return-from pattern (or discards secondary values)

modern-backend.org / modern.lisp:
- Replace simple ioctl-only prose with 4-step fallback chain
- Document env-var pre-check and /dev/tty fallback

text-input.org / input.lisp:
- Update read-raw-byte prose: with-pinned-objects/vector-sap
  instead of alien buffer (code was already correct, prose stale)
- Add missing (require :sb-posix) to SIGWINCH handler code block
- Document :sb-posix requirement in prose
2026-05-14 16:25:45 -04:00
22886c1794 fix: add draw-text method for raw 2D arrays
Application code (passepartout TUI) calls draw-text with a framebuffer
(2D array) as the first argument, but draw-text only had methods for
framebuffer-backend CLOS instances. Added a method on array that sets
cells directly on the framebuffer array, matching make-framebuffer's
return type.
2026-05-13 16:06:05 -04:00
Hermes Agent
3cbcfd2d75 v1.0.0 release
Bug fixes:
- Fix OSC8 format strings (backslash escape layering) in modern-backend.org
  - Test format string had single backslash instead of double, causing
    unclosed CL string that cascaded through 3 subsequent test forms
  - Implementation format string had leading escaped quote (not a string
    opener) and triple-backslash ending (also not a string terminator)
- Fix missing closing parens in border-char-rounded and border-char-double tests
- Fix ASDF input-tests pathname (file lives in tests/, not src/components/)

New features:
- Implement suspend-backend / resume-backend protocol methods
  - modern-backend: exit/enter alt screen, re-enable mouse/kitty/bracketed-paste
  - simple-backend: no-ops (no terminal state to preserve)

Infrastructure:
- Update test suite to cover suspend/resume (backend + modern-backend suites)
- 454 checks, 100% pass across 14 test suites
2026-05-12 20:00:27 +00:00
Hermes Agent
352f27e260 fix: osc8-link doubled backslashes in format string
The osc8-link implementation and its test both had doubled
backslashes (\\ -> \\) in their format strings, producing two
literal backslashes at runtime instead of the single backslash
needed for the OSC 8 string terminator (ST = ESC \).

Fix: change \\ to \\ in both the implementation and test format
strings. The tangled .lisp files now have correct escaped
backslashes (\) producing one backslash in the runtime string.

Additionally clean up a patch artifact that left a stray backslash
before the opening quote.
2026-05-12 19:26:00 +00:00
Hermes Agent
29f99a576d literate: restructure all 19 org files with per-function blocks and prose
Every function, defclass, defstruct, defgeneric, defmethod, defmacro,
defvar, and defparameter in every org file now has its own #+BEGIN_SRC
block with literate prose above it explaining the design reasoning.

Block counts before → after:
  package.org:           1 → 7
  container-package.org: 1 → 1 (prose expanded)
  dirty.org:             4 → 6
  render.org:           10 → 25
  theme.org:             6 → 19
  box-renderable.org:    9 → 29
  scrollbox.org:         8 → 26
  tabbar.org:            5 → 10
  backend-protocol.org:  8 → 66
  modern-backend.org:   17 → 53
  detection.org:         4 → 6
  layout-engine.org:     9 → 36
  framebuffer.org:       8 → 37
  markdown-renderer.org:13 → 38
  dialog.org:           17 → 23 (merged dual structure)
  mouse.org:             4 → 25
  select.org:           12 → 30
  slot.org:              4 → 12
  text-input.org:       11 → 53

Total: ~153 blocks → ~502 blocks

Bugs fixed during restructuring:
- render.org: stray π character typo (backenπd → backend)
- modern-backend.org: sgr-attr missing closing paren + #+END_SRC
- detection.org: invalid #\Esc character reference
- select.org: extra closing paren in select-visible-options

All 13 test suites pass at 100%.
2026-05-12 18:55:07 +00:00
Hermes Agent
c77c6b9d02 literate: convert org/modern-backend.org from doc-only to tangle source
Now tangles to modern.lisp + modern-tests.lisp.
Deleted hand-written originals and regenerated from org — GREEN.
2026-05-12 17:14:37 +00:00
Hermes
811d51a4f2 Rename cl-tui -> cl-tty, v0.9.0: Dialog System + Toast
Rename: cl-tty avoids naming collision with Quicklisp's cl-tui (naryl/cl-tui,
a cl-charms-based ncurses library). Our project is pure escape-sequence CL.

v0.9.0 adds:
- Dialog base class: modal overlay with backdrop, centered panel, size
  variants (:small/:medium/:large), stack-based management
- Dialog subclasses: alert, confirm, select-dialog, prompt-dialog
- Toast notifications: transient, top-right corner, auto-dismiss,
  colored variants (info/success/warning/error)
- 78 tests total, 100% passing

ASDF: read-time package references (+fiveam:+) replaced with
find-symbol so .asd loads without FiveAM pre-loaded
2026-05-11 19:55:37 +00:00
Hermes
0397d1de2c v0.0.2: modern backend — raw escape sequences
Implements the modern-backend with truecolor SGR, Unicode box-drawing
(rounded/double/single), DECICM synchronized updates, OSC 8 hyperlinks,
cursor style control, and hex color parsing.

RED: 32 checks, 5 fail (class forward-ref + test bug)
GREEN: 32/32 checks passing (100%)

- backend/modern.lisp — escape generators + modern-backend class
- backend/modern-tests.lisp — 16 test cases, 32 assertions
- backend/package.lisp — updated exports
- org/modern-backend.org — literate source
2026-05-11 12:53:55 +00:00