Skip to content

docs(read): #806 CR NIT-1/NIT-2 — partial-timeout next-reader consequence; trim-layer pointer - #836

Merged
caomengxuan666 merged 1 commit into
masterfrom
fix/806-nits
Oct 18, 2026
Merged

caomengxuan666 merged 1 commit into
masterfrom
fix/806-nits

Conversation

@caomengxuan666

Copy link
Copy Markdown
Member

Follow-up to #816 (cr-816 APPROVE-WITH-NITS), documentation only — no behavior change.

NIT-1 — next-reader consequence of the partial-timeout divergence

The `-t` partial-timeout note (CHANGELOG #806 entry + `leg_t_partial_assign` driver comment) covered only the record content. Now it also states what happens to the held-back bytes:

  • GNU: the line discipline holds them; once an Enter completes the held-back line the NEXT reader receives it (oracle WSL 5.3.0: `read b` ⇒ `B=[hello]`).
  • rubash: the one-char path consumed them into `a` (`A=[hello]`), so the next reader only sees input typed after the timeout (`B=[zzz]`).

Not `read.def:553` equivalence — neither side loses the bytes, they change owner. Anchored at `tests/interactive/support/conpty_read_probe.py` (the oracle-measured legs) and the CHANGELOG #806 entry.

NIT-2 — "Pipe/file reads keep raw CRs" is gate-local

The ICRNL comments in `read_stdin_until` and `read_inherited_process_stdin` now point at the trim layer: on Windows `trim_read_input_literal`'s wave-2 pop still strips a record's trailing CR after the gate, so a CRLF pipe is NOT byte-GNU end to end (`printf 'x\r\n' | read x; ${#x}` = 5 vs GNU 6; pre-existing at 74e60b0, carries the trim layer's own NOTE). Prevents reading the gate comment as "CRLF pipes are aligned".

Verification

Docs-only: touched files are two Rust comment blocks, the CHANGELOG line, and the python driver comment. `python -m py_compile` on the driver and `cargo fmt --check` on the touched Rust files clean; no code paths changed.

…ence; ICRNL comments point at the trim layer

cr-816 APPROVE-WITH-NITS follow-up, documentation only:

NIT-1: the partial-timeout divergence note covered only the record
content. State the NEXT-READER consequence at both sites (CHANGELOG #806
entry, leg_t_partial_assign driver comment): GNU's line discipline holds
the bytes and hands the held-back line to the NEXT reader once an Enter
completes it (oracle read b => B=[hello]); rubash's one-char path consumed
them into a, so the next reader only sees post-timeout input (B=[zzz]).
Not read.def:553 equivalence — neither side loses the bytes, they change
owner.

NIT-2: the ICRNL comments' "Pipe/file reads keep raw CRs" is true only at
the translation gate. On Windows trim_read_input_literal's wave-2 pop
still strips a record's trailing CR afterwards, so a CRLF pipe is NOT
byte-GNU end to end (printf 'x\\r\\n' | read x; ${#x} = 5 vs GNU 6;
pre-existing at 74e60b0). Both comment sites (read_stdin_until,
read_inherited_process_stdin) now point at the trim layer's NOTE.
@caomengxuan666
caomengxuan666 merged commit bd4f703 into master Oct 18, 2026
8 checks passed
@caomengxuan666
caomengxuan666 deleted the fix/806-nits branch October 18, 2026 23:25
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