PHP 8.7 proposal targets native terminal support
Pratik Bhujel has proposed Io\Terminal for PHP 8.7.
The API would add native terminal sessions, size detection, safe raw mode, normalized key input, and hidden input to ext/standard. A reduced implementation is under review in php-src pull request 23941. The RFC uses Time\Duration and seeks feedback before voting.
Pratik Bhujel has submitted an RFC for Io\Terminal, a proposed API for PHP 8.7. It would place a compact terminal interface in ext/standard. The planned capabilities cover terminal sessions, native terminal-size queries, raw mode with safe restoration, normalized key input, and hidden input.
The proposal follows an earlier php-internals discussion about native terminal helpers. Symfony Console and TUI integration helped focus the core on functionality that needs cross-platform native support. The RFC also consolidates earlier discussion whose replies were split across separate archive threads.
A reference implementation already exists as ext-terminal, distributed through PIE and Packagist under prateekbhujel/php-terminal. A draft php-src implementation is available in pull request 23941. The draft follows the reduced core API and omits the full ext-terminal 1.x surface.
The core design uses Time\Duration for timeout values. It has no public constructor and initially excludes compatibility aliases, environment-based terminal-size fallbacks, and convenience APIs. Bhujel is asking for feedback before the vote.
Readers’ Forum
No contributions yet — open the debate.
Open the discussion
No account or password needed — just enter your e-mail and we’ll send you a one-time sign-in link. First time here? You’re set up automatically.
Your rating will be applied automatically after you sign in.
Check your inbox
We’ve sent a sign-in link to …. Open it on this device — this tab will sign you in automatically.
Nothing arrived? Check your spam folder — and mark the mail as "Not spam" so it lands in your inbox next time.