Repository navigation
Add /dev/tty support - #1689
Merged
Merged
Add /dev/tty support#1689
Conversation
Weidong Cui (wdcui)
force-pushed
the
wdcui/ulitebox/dev-tty
branch
from
October 21, 2026 17:35
7e21b23 to
1f07d5a
Compare
Make the terminal endpoint a full I/O endpoint and expose the controlling terminal through the stdio provider. The broker's /dev backend now serves /dev/tty and routes every terminal-backed stdio stream through the terminal endpoint; opening /dev/tty without a controlling terminal fails with ENXIO. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 1172b488-1351-40c1-a6d0-32f5277af568
The guest now has at most one terminal, its controlling terminal, and each standard stream that refers to it is a view of it. Without one, nothing is a terminal: isatty is false, terminal ioctls fail with ENOTTY, and opening /dev/tty fails with ENXIO. The half-terminal that accepted settings without applying them is gone. The userland broker takes the host controlling terminal only when it is verifiably in the foreground process group and no standard stream is a pipe or socket. The terminal's signal sink is attached to the initial process group when it is created, so Ctrl-C reaches the guest even when no stream is a view. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 1172b488-1351-40c1-a6d0-32f5277af568
Name the per-stream flags after StdioProvider::is_terminal, which they back, and describe streams as referring to the terminal rather than as views of it. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 1172b488-1351-40c1-a6d0-32f5277af568
Correct the test terminal docs, which described reads as waiting and terminal_writes as driving I/O, and reword unclear comments. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 1172b488-1351-40c1-a6d0-32f5277af568
Weidong Cui (wdcui)
force-pushed
the
wdcui/ulitebox/dev-tty
branch
from
October 22, 2026 01:38
3a26dec to
6cab99d
Compare
|
🤖 SemverChecks 🤖 Click for details |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds
/dev/ttyand gives the guest at most one terminal, its controlling terminal, which any standard stream may refer to. The userland broker takes the host controlling terminal only when it is verifiably in the foreground and no standard stream is a pipe or socket; otherwise nothing in the guest is a terminal (isatty false, ENOTTY,/dev/ttyENXIO). Terminal signals reach the initial process group even when no stream refers to the terminal. Tests cover the broker, shim, and runner.