[ANN] cross terminal terminal library for Lua released

53 views
Skip to first unread message

Thijs Schreijer

unread,
Jun 7, 2026, 4:18:38 PM (6 days ago) Jun 7
to lu...@googlegroups.com
List,

happy to announce that I have finally released the first version (0.1.0) of the `terminal` library. It is a cross-platform terminal library supporting *nix and bsd variants, and Windows, and Lua versions 5.1 to 5.5. Some 18 months ago I announced its existence, lots of high-level functionality has been added since. First commit was 2 years ago.

This library does not depend on external libraries (e.g. curses, ncurses, SDL and the likes). It relies only on LuaSystem (and utf8 lib for older Lua versions), this should make it a lot easier to build (especially on Windows), since LuaSystem only binds to platform APIs. So for a novice on Windows it should be easier to get this operational. A working LuaRocks installation should get anyone up and running, no fiddling required with external .dll/.so files and/or development headers to build it.

Installation: `luarocks install terminal`

Low-level features:
  • Full UTF-8 support for emojis and other Unicode characters. Advanced string handling for UTF-8 characters as well as display columns.
  • Non-blocking keyboard input; enabling coroutine based multithreading with background tasks, no more `io.read` blocking everything. (a line-editor was written in Lua to enable this). 
  • Core terminal functionality to setup streams non-blocking, canonical mode, etc, and ANSI control sequence support (colors, cursor movements, etc)
  • Mechanisms over policies; the library will not claim the main loop, nor does it bring in an event system or require callback-spaghetti. It can be easily hooked up, but doesn't force this upon the user (this was the main issue I had with most other UI libraries)

High-level functionality:
  • CLI widgets; selections (radio button), multi-select (checkboxes), text input prompts, progress bars and spinners, etc.
  • Full-screen UIs; panel system with automatic layouts, headers, footers, text panels with word-wrapping scrolling etc, confirmation dialog boxes, tabstrip, and more
  • Canvas; unicode braille char based canvas to be used from either CLI or full-screen UIs. Drawing primitives; dots, lines, ellipses, arcs, polygons (optionally filled). It even includes a time series graph.

Rationale: 

Ever since I started with Lua I have wondered how to make it easier for novices (like me at the time) to get started. I still think that most will start from a Windows environment (as I did), which just makes it extra hard to get started. Just setting up a compiler and using a cli is already a challenge, let alone building stuff from source, binding to external libraries and what not.

Hence a number of my projects have always been aimed at making it easier to get started with Lua and to enable a novice to still write a fully functional application, with a focus on cross-platform support. A Windows specific example is LuaWinMake and LuaWinMulti, the former is a simple standalone Windows batch file that (given a working compiler) will build any Lua version (5.1-5.5) from source without needing `make`, `cygwin`, etc. The latter uses the former and adds a LuaRocks installation.

I have maintained (and extended) Copas for this purpose over the years (evolved from a socket scheduler to a generic coroutine scheduler). And with the addition of this new terminal library I feel like I'm finally closing the loop; adding UI capabilities, and non-blocking keyboard input.

If you read this far; thanks :)
Please give it a spin, all feedback welcome.

Big shout out to the GSoC students (selected and non-selected) for helping out adding features and fixing bugs!

Thijs

Payo Nel

unread,
Jun 7, 2026, 5:00:21 PM (6 days ago) Jun 7
to lu...@googlegroups.com
I really love and can appreciate the work you've done here. I developed a collection of shell libraries, written in lua. I'm familiar with the work you've done here, and I think you've organized it very nicely.

From: 'Thijs Schreijer' via lua-l <lu...@googlegroups.com>
Sent: Sunday, June 7, 2026 8:18 PM
To: lu...@googlegroups.com <lu...@googlegroups.com>
Subject: [ANN] cross terminal terminal library for Lua released
 
--
You received this message because you are subscribed to the Google Groups "lua-l" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lua-l+un...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/lua-l/4b7fe47e-b39a-4adb-a133-356d4474b25d%40app.fastmail.com.

Martin Eden

unread,
Jun 7, 2026, 5:31:22 PM (6 days ago) Jun 7
to lu...@googlegroups.com
On 2026-06-07 22:18, 'Thijs Schreijer' via lua-l wrote:
> List,
>
> happy to announce that I have finally released the first version
> (0.1.0) of the `terminal` library
> <https://github.com/lunarmodules/terminal.lua>. It is a cross-platform
> terminal library /_supporting *nix and bsd variants, and Windows, and
> Lua versions 5.1 to 5.5_/. Some 18 months ago I announced its
> existence
> <https://groups.google.com/g/lua-l/c/JOwxp1k4Y_E/m/9JkM_XJFBwAJ>, lots
> of high-level functionality has been added since. First commit was 2
> years ago.
> [...]
Nice medium-sized personal project. (Reminds me TekUi.) I'm glad we have
it in Lua. My congratulations with release, Thijs!

My question is about scope of project. In what directions you are going
to evolve?

Are you going to further advance dithering and rendering in Unicode
characters (like add 3D with dynamic lighting)? Are you going to add
more widgets (combo-boxes, tabs, panels)? Or this project is mostly done
and there will be only code-quality changes (ideal for me)?

-- Martin

Thijs Schreijer

unread,
Jun 8, 2026, 2:13:22 AM (5 days ago) Jun 8
to lu...@googlegroups.com


On Sun, 7 Jun 2026, at 23:31, 'Martin Eden' via lua-l wrote:
> My question is about scope of project. In what directions you are going
> to evolve?
>
> Are you going to further advance dithering and rendering in Unicode
> characters (like add 3D with dynamic lighting)? Are you going to add
> more widgets (combo-boxes, tabs, panels)? Or this project is mostly done
> and there will be only code-quality changes (ideal for me)?
>
> -- Martin

My take; evolve from here, add a few widgets and UI elements as the need arises. But might vary depending on feedback.

Thijs

Pierre Chapuis

unread,
Jun 8, 2026, 4:13:18 AM (5 days ago) Jun 8
to lu...@googlegroups.com
Thanks, I have a small tool using it that was built with an old version, upgrading was painless (just had to remove the `.stack` accessors removed in PR 216).


-- 
Pierre Chapuis
Reply all
Reply to author
Forward
0 new messages