r/C_Programming • u/rob-bix • Sep 23 '26
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:
Or install it on macOS/Linux via Homebrew:
Any bug reports, edge-case discoveries, or code suggestions (either here or via GitHub Issues) are greatly appreciated. Thanks for checking it out!
View all comments
Show parent comment
2
u/imaami Sep 27 '26 edited Sep 27 '26
If you want to see my take on valid UTF-8 state transitions: https://i.imgur.com/nVfDRT8.png
It's from my moderately cursed parser: https://github.com/imaami/c.utf-8
I'm fairly sure the code itself isn't anything you'd want to borrow from. It's weird, to say the least. But it accepts and rejects the right bytes per the UTF-8 spec. The flowchart is generated from the same Xmacros table the parser is based on.
If you want to use even some small part of c.utf-8, but would prefer a license other than what I chose, just let me know and I'll type up an explicit relicensing statement. Tbh I don't remember what I have even, it's some form of GPL anyway.
Edit: I happened to notice your post has 0 upvotes. Sometimes I just don't get at all why this subreddit is like that.