Mist: ANSI Friendly Terminal Toolkit

Hello everyone! I’ve recently refactored mist to be more of a terminal manipulation library. It includes everything from text styling to parsing terminal events.

Short list of features:

  • Text styling (emphasis and coloring)
  • ANSI Aware text transformations (padding, indent, dedent, wrapping, etc.)
  • Terminal control (alternate screen buffer, focus tracking, mouse capture, screen/session state, cursor manipulation support)
  • Convenient TTY context manager
  • Terminal Event Parsing (Key Events, Focus Gain/Lost, Bracketed Paste, Mouse Events)

Please check out the README for more information on the features available! I created this project to learn more about TUI development and saw how deep the rabbit hole really goes. There’s a lot of differences between different terminal emulators, so I’m always open to PRs and to learn more about the topic.

4 Likes

I have some projects that need refactoring to use this! :fire: Great updates!

1 Like

Awesome! Let me know how it goes. I’ll be opening up a PR to get the latest version into the modular-community channel soon.

1 Like

I’ve added a few TUI examples leveraging mist for terminal control and mog for terminal styling.

There are gifs of them in action here: GitHub - thatstoasty/banjo: Mojo termios via libc

Examples: