Skip to content

Add interactive TUI menu support, terminal helpers, and tests#1

Merged
joejollands merged 1 commit into
mainfrom
codex/review-project-and-create-improvement-plan
Jan 15, 2026
Merged

Add interactive TUI menu support, terminal helpers, and tests#1
joejollands merged 1 commit into
mainfrom
codex/review-project-and-create-improvement-plan

Conversation

@joejollands

@joejollands joejollands commented Jan 15, 2026

Copy link
Copy Markdown
Contributor

Motivation

  • Provide basic TUI building blocks (raw-mode input, key parsing, cursor/screen control) to enable interactive menus and embedded inputs.
  • Prevent leaving the terminal in an unusable state by adding safe raw-mode enable/restore patterns and cursor hide/show helpers.
  • Offer a simple, composable API for single-select menus, checkboxes, and radio lists that fits the existing command traits.

Description

  • Add terminal helper classes TerminalMode, TerminalInput, TerminalControl, and KeyPress to manage raw mode, read keys, and emit ANSI cursor/text sequences (e.g. stty handling, stream_select(), ESC sequences, ESC[H, ESC[2J, ?25l/?25h).
  • Implement InteractiveMenu to render and drive single-select menus, checkbox multi-selects, and radio lists with highlighting and safe try/finally cleanup.
  • Expose menu helpers via a new trait HasInteractiveMenus and wire it into both IGC\Tart\Laravel\StyledCommand and IGC\Tart\Symfony\StyledCommand.
  • Update docs: add interactive menu examples to docs/guides/QUICK-REFERENCE.md, and mark completed items in docs/feature-todo.md related to menus and terminal helpers.

Testing

  • Added unit tests tests/Unit/KeyPressTest.php for KeyPress::fromBytes() and tests/Unit/TerminalControlTest.php for TerminalControl sequences; the tests validate key parsing and ANSI sequence strings.
  • No automated test run was executed in this environment, so test results are not available.

@joejollands joejollands merged commit 29c7371 into main Jan 15, 2026
0 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant