Simple TUI picker - sel

Sel

Sel is a TUI (Text User Interface) picker I’m writing in Zig. You input a string list in stdin, select an entry and the selected entry will be written on stdout. Kind of like fzf but without the steroids.

I started this project to learn how TUIs work in a terminal, and to interface it with my text editor in order to provide a pleasant file switching mechanism, even though it can already be used for various other tasks.

After initially starting to write the program in C, I slowly realized that working with this language for OS tasks was like navigating on a road full of bumps/holes and patchwork, and the niceties of Zig (defer, try, build tools, C interfacing… etc.) were really tempting.

In the end, Zig is a great choice for such a project and I really like working on it on my free time. If you want to try it out, the code is available on sr.ht. Feedback is appreciated; do not hesitate to report bugs and crashes on the tracker.

7 Likes

Welcome to Ziggit @ataractic!

I like your project, it embodies the classic Unix philosophy.

What might be neat would be to package the core functionality as a standalone module, which used a Reader and Writer for the inputs and outputs, and handles the terminal interactions for making the selection. That would make it suitable for use in something like an install script, for setting preferences interactively. Another way to reuse the component, besides shell pipes.

Thank you, the Unix Philosophy was indeed an inspiration.

Great idea; it’s not planned for now, but it could probably come after 1.0.0 if it appears to be useful.

1 Like