Skip to content

Commit e4d6cda

Browse files
authored
Merge pull request #2 from compoundingtech/schickling-assistant/2026-08-03-compatibility-embedding-direction
docs: define compatibility and embedding direction
2 parents 4fba12f + 0dd168d commit e4d6cda

1 file changed

Lines changed: 33 additions & 2 deletions

File tree

README.md

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,34 @@ Two things live here:
1515
`Session` type), which is also the foundation the CLI is built on and the
1616
correctness net for the port.
1717

18+
## Direction: compatibility and embedding
19+
20+
The long-term target is a behavior-compatible Rust implementation of the Node
21+
`pty`, plus a first-class Rust API for embedding a live terminal in clients such
22+
as Fractal. The Node implementation is the behavioral reference while the port
23+
converges. This README does not claim that the current experiment has reached
24+
full parity.
25+
26+
Compatibility means that the same user-visible operations and wire messages have
27+
the same result. It does not require identical source code or internal design.
28+
Rust, `portable-pty`, and `libghostty` can require a different implementation.
29+
When that difference changes behavior, record a decision that states the Node
30+
behavior, the Rust behavior, the reason, the client effect, and the conformance
31+
test.
32+
33+
The embedding API should serve the Rust CLI and other Rust clients through one
34+
implementation. Its terminal handle should eventually provide the capabilities
35+
that Node's `@myobie/pty/tui` `PtyHandle` provides: attach lifecycle, input,
36+
resize, typed cell-grid and wrapped-line reads, cursor and terminal-mode state,
37+
scrollback access, and activity or exit events. `libghostty::Terminal` is not
38+
`Send`, so one clear actor must own it and publish typed events or snapshots to
39+
consumers.
40+
41+
Keep the current protocol as the baseline. Add a protocol feature only after a
42+
real failing use case shows that the current byte-framed messages cannot express
43+
the required behavior. Track the compatibility matrix, crate boundaries, and
44+
acceptance tests in [issue #1](https://github.com/compoundingtech/pty-rust/issues/1).
45+
1846
[libghostty]: https://libghostty.tip.ghostty.org/
1947
[Ghostty]: https://ghostty.org
2048

@@ -120,7 +148,7 @@ thereafter.
120148
cargo test
121149
```
122150

123-
156 tests pass:
151+
173 tests pass:
124152

125153
| Test file | Ported from | Count | Backend |
126154
| --- | --- | --- | --- |
@@ -137,7 +165,10 @@ cargo test
137165
| `tests/terminal_spawn.rs` | `screenshot.test.ts` / `shells.test.ts` | 11 | **libghostty** |
138166
| `tests/terminal_fidelity.rs` | `screen-replay-altscreen` / `scrollback-fidelity` | 4 | **libghostty** |
139167
| `tests/interactive_tui.rs` | interactive-editing (Playwright-style) | 3 | **libghostty** |
140-
| `tests/cli_e2e.rs` | `pty` CLI lifecycle / up-down / restart / attach (Ctrl+\\ detach + double-tap) / follow / nesting | 7 | **libghostty** |
168+
| `tests/parity.rs` | Node behavior parity cases | 7 | pure + **libghostty** |
169+
| `tests/parity_fixtures.rs` | shared Node/Rust JSON fixtures | 2 | **libghostty** |
170+
| `tests/registry_liveness.rs` | Node-compatible registry liveness | 1 | pure |
171+
| `tests/cli_e2e.rs` | `pty` CLI lifecycle / up-down / restart / attach (Ctrl+\\ detach + double-tap) / follow / nesting | 14 | **libghostty** |
141172
| doctest || 1 ||
142173

143174
`interactive_tui.rs` drives `bash`'s raw-mode readline through the harness —

0 commit comments

Comments
 (0)