Provide a low-level cross-platform terminal platform layer
- Dominant language
- LLVM
- Stars
- 1
- Forks
- 0
- Avg merge
- 1d 17h
- Merged PRs (30d)
- 4
Description
## Summary
Provide a low-level terminal package for TTY detection, dimensions, raw mode, screen lifecycle, output, and semantic keyboard events. This need not be a full widget framework.
## Motivation
The GitHub dashboard required a POSIX C shim for `termios`, `ioctl(TIOCGWINSZ)`, alternate-screen ANSI sequences, cursor visibility, and escape-sequence decoding. Every Plum TUI would otherwise need to recreate this platform layer.
## Possible API
```plum
Terminal.is_tty()
Terminal.size(): Result[TerminalSize, TerminalError]
Terminal.enter_raw(): Result[RawTerminal, TerminalError]
Terminal.read_event(): Result[TerminalEvent, TerminalError]
Terminal.write(text: String): Result[Unit, TerminalError]
```
Keyboard input should use semantic values such as `Key.Up`, `Key.Enter`, and `Key.Character(s)` rather than application-defined integer codes.
## Acceptance criteria
- Supports Plum's published platforms, or clearly reports platform support.
- Restores terminal state through an explicit lifecycle API.
- Reports resize and common key events semantically.
- Includes a small interactive example.
Contributor guide
No contributing guide indexed for this repository
Research direction
No implementation files or tests are named. Start by reviewing the GitHub dashboard's POSIX C shim requirements and the proposed Terminal API, then determine platform support and lifecycle boundaries. Done means terminal state is restored explicitly, resize and common key events are semantic, supported platforms are documented, and a small interactive example is included.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c
- Domain
- cli, operating-systems
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100