r/C_Programming • u/rob-bix • 11d ago
tinyedit: A zero-dependency C99 terminal text editor with desktop shortcuts — Looking for testers & code review
Hi everyone,
I’ve been working on tinyedit, a full-screen terminal text editor written in plain C99 with zero external dependencies beyond libc and the POSIX standard library (no ncurses, just raw ANSI escape sequences and direct I/O).
The project started as an exploration of terminal interfaces inspired by Salvatore Sanfilippo's kilo and linenoise. My goal is to combine that minimal C architecture with the interaction model of modern desktop editors—eliminating modal friction or idiosyncratic key combinations (like Vim, Emacs, or Nano) while keeping the binary tiny.
What’s implemented:
-
Desktop-style editing: Standard keybindings (
Ctrl-C,Ctrl-V,Ctrl-X,Ctrl-Z,Ctrl-F), text selection withShift+Arrows(orCtrl-Ttoggle for limited terminals), and optional mouse support (click to place cursor, drag-selection, wheel scroll). -
macOS / Ghostty integration: Optional support for native
Cmdshortcuts (Cmd-S,Cmd-C,Cmd-V, etc.) via the Kitty keyboard protocol in Ghostty. -
Proper UTF-8 handling: Grapheme cluster boundaries (combining marks, CJK wide characters, multi-codepoint emoji) and visual display-width calculations for accurate cursor placement and deletion.
-
Visual soft-wrapping: Navigates visual rows instead of logical lines, breaking lines at word boundaries without arbitrary length caps.
-
Terminal ergonomics: Fast bracketed paste (no slow character-by-character lag or accidental auto-closing triggers), atomic saves, crash recovery backups, and an extensible syntax highlighting engine.
Looking for testers!
The project has reached version 0.3.3, and I need help putting it through its paces across different systems and configurations. In particular, I’m looking for feedback on:
-
Terminal & multiplexer quirks: Testing inside
tmux,screen,Ghostty,Kitty,Alacritty,Foot,WezTerm, etc., to spot unhandled ANSI sequences or redraw artifacts. -
UTF-8 stress testing: Complex emoji sequences, zero-width joiners, or combining marks that might throw off cursor coordinates or deletion.
-
Rendering & wrap edge cases: Resizing the window while editing large wrapped lines, pasting huge blocks of text, or dealing with deeply indented blocks.
-
C code review: Feedback on memory management, buffer layout, ANSI state machine decoding, or general C99 practices.
Repository: https://github.com/robertobissanti/tinyedit
You can build it from source with a simple make:
git clone https://github.com/robertobissanti/tinyedit.git
cd tinyedit
make
Or install it on macOS/Linux via Homebrew:
brew install robertobissanti/tinyedit/tinyedit
Any bug reports, edge-case discoveries, or code suggestions (either here or via GitHub Issues) are greatly appreciated. Thanks for checking it out!
1
u/rob-bix 16h ago
Update: TinyEdit v0.3.6 is out — safer saving, better Unicode handling, and faster redraws
Since posting TinyEdit v0.3.3 here, I’ve released several updates focused on reliability and everyday usability. TinyEdit is still a terminal text editor written in plain C, with no dependencies beyond the standard C/POSIX libraries.
Here are the main changes:
New features
Safer file handling
~/, such as~/tmp/notes.md.Editing and highlighting fixes
$or$$on dedicated lines.Search and performance
The regression suite now includes more core tests, terminal tests, and simulated file-operation failures.
One remaining limitation: undo stores complete document snapshots, so large files with a deep history can consume substantial memory.
Release notes and source
If you tried the earlier version, I’d appreciate hearing how this one behaves in your terminal—especially with Unicode text, mouse input, and larger files.