5 Commits

Author SHA1 Message Date
Salvatore Sanfilippo
1976997c38 Rename linenoise_example to linenoise-example 2026-01-07 22:50:02 +01:00
Salvatore Sanfilippo
a7b86c1744 Add test framework with VT100 terminal emulator
Implement comprehensive test suite for linenoise:

VT100 Terminal Emulator:
- Column-based UTF-8 representation with display width tracking
- Each screen cell stores complete UTF-8 characters (up to 32 bytes)
- Proper handling of wide characters (emoji, CJK) as 2-column cells
- ZWJ tracking for grapheme cluster storage
- Escape sequence parsing for cursor movement and screen clearing

Test Harness:
- Fork/pipe architecture for testing via LINENOISE_ASSUME_TTY
- Visual rendering to real terminal for debugging failed tests
- Assertion helpers for screen content and cursor position

Test Coverage (72 tests):
- Basic typing and cursor movement
- UTF-8 input and navigation (é, 中, 🎉)
- Emoji cursor movement and deletion
- Grapheme clusters (heart+VS, thumbs up+skin tone, rainbow flag)
- Horizontal scrolling with long lines
- Horizontal scrolling with UTF-8 content
- Multiline mode basics
- Multiline history navigation (regression test)
- Word/line deletion (Ctrl-W, Ctrl-U)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-07 21:58:30 +01:00
antirez
ce845468b0 Support API to save/load history on file 2010-07-07 18:26:23 +02:00
antirez
42ba034ea4 enabled debugging symbols in Make, used NULL instead of 0 introduced for a typo 2010-07-07 13:28:26 +02:00
antirez
6de190829e first commit 2010-03-21 00:01:52 +01:00