Skip to content

feat(pty): canonical-mode line editing (VKILL/VWERASE) + ECHOCTL caret echo#166

Merged
NathanFlurry merged 1 commit into
mainfrom
nathan/pty-line-editing
Jul 1, 2026
Merged

feat(pty): canonical-mode line editing (VKILL/VWERASE) + ECHOCTL caret echo#166
NathanFlurry merged 1 commit into
mainfrom
nathan/pty-line-editing

Conversation

@NathanFlurry

Copy link
Copy Markdown
Member

Recovers and ports the displaced kernel PTY line-editing work onto the converged terminal.

  • pty.rs: VKILL (Ctrl-U, kill-line) + VWERASE (Ctrl-W, word-erase) control chars + process_input branches; ECHOCTL caret-form control-char echo (e.g. 0x01^A); a column-accurate erase_sequence helper (one BS SP BS per display column, so caret-echoed control chars erase correctly).
  • guest_pty.rs: wire the two new control chars over the tcsetattr/tcgetattr path.
  • 8 new kernel pty unit tests (kill/werase/echoctl + erase-after-echoctl); full pty suite 24/24 green, no existing tests weakened.
  • Double-print: investigated. The convergence "real terminal client" surfaces a child's stdout exactly once (no PTY-master drain; child spawn doesn't dup2 the parent's slave), so the old double-surfacing path no longer exists and a suppression guard would guard nothing. Documented as a // TODO(double-print) at the stdio-write site rather than fabricating a fix.

main already had opost/onlcr/LineDiscipline/VERASE from the convergence merge; this adds only the missing line-editing.

…t echo

Ports the recovered kernel line-discipline work onto the converged terminal:
- pty.rs: VKILL (Ctrl-U kill-line) + VWERASE (Ctrl-W word-erase) control chars
  and process_input branches; ECHOCTL caret-form control echo; column-accurate
  erase_sequence helper.
- guest_pty.rs: wire the two control chars over tcsetattr/tcgetattr.
- 8 new kernel pty unit tests.
Double-print: investigated; the convergence model surfaces child stdout once
(no PTY-master drain), so no guard is warranted — documented as a TODO.
@railway-app railway-app Bot temporarily deployed to secure-exec / secure-exec-pr-166 July 1, 2026 20:10 Destroyed
@NathanFlurry NathanFlurry merged commit 2e90d52 into main Jul 1, 2026
0 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant