Add terminal builtins for raw input mode #276
Labels
No labels
bug
dependencies
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
refactor
rust
technical-debt
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
navicore/patch-seq#276
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Add built-in terminal functions to the runtime for raw input mode, enabling vim-style line editing and TUI applications in pure Seq.
Proposed API
Use Cases
Implementation Notes
Add to
crates/runtime/src/using directlibccalls:tcgetattr/tcsetattrfor raw moderead(STDIN_FILENO, ...)for character inputfcntlfor non-blocking modeioctl(TIOCGWINSZ)for terminal sizeSafety considerations:
atexithandler to restore terminal on exitWhy Builtins vs FFI
Originally considered as FFI, but that required users to build and distribute a custom shared library. Builtins are the right approach because:
io.write-line, etc.)Related
Tests
Add to
crates/runtime/src/terminal.rs(or similar):Note: Full interactive testing requires a TTY, so unit tests are limited. Manual testing with the example is important.
Example
Add
examples/terminal-demo.seq:No FFI includes, no library paths - just works.
https://github.com/navicore/patch-seq/pull/277