Repository navigation
fix(input): normalize C0 control bytes on bridge-delivered interactive lines - #458
Merged
Merged
Conversation
caomengxuan666
added a commit
that referenced
this pull request
Oct 9, 2026
caomengxuan666
added a commit
that referenced
this pull request
Oct 10, 2026
…#478) - Delete docs/{TASK-BOARD,TASKBOARD,QUEUE-PROMPTS,PERF-BASELINE,CORPUS-COVERAGE,COMPATIBILITY-STATUS,LINUX-RUN-STATUS}.md: dated status snapshots / session handoffs whose content lives in git history and the issue tracker. Still-valid baseline numbers (perf table, corpus coverage, 2026-10-02 compat ledger) are excerpted into issue #477. - AGENTS.md/README/README.zh-CN: repoint dangling references to the issue tracker. - CHANGELOG: record SIGPIPE semantics (#455), interactive input C0 normalization (#458), and android bionic targets (#456) under Unreleased. Co-authored-by: docs-audit <[email protected]>
This was referenced Oct 10, 2026
Merged
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.
closes #434. Related: niubash#451 cluster (the
hang:source:^Ucommand echo ECOSRC0x15/NAK injection family).Problem
A line delivered through a winpty/ConPTY bridge is an encoding of typed TEXT, not a keystroke stream: a literal
\1typed by the user reached the interactive reader as byte 0x01 and was honored as console Ctrl-A (cursor-home), silently corrupting the edit buffer (echo \x01xexecuted asxecho). The sibling #451 family injected 0x15 (Ctrl-U/NAK) the same way.Fix
One input-layer normalization, not per-byte patches:
run_interactive_stdinnow runs every cooked line throughnormalize_bridge_linebefore the edit dispatch. C0 control bytes (0x00-0x1F) without cooked-line semantics — cursor motion (C-a/C-e/C-b/C-f), kill (C-k/C-u), isearch (C-r), history (C-p/C-n) and the unbound rest — are dropped, so they can neither act on nor enter the command-line buffer.Details the walk has to cover:
bytes_to_shell_textmarker-tags the carrier bytes (0x0c/0x11/0x13 plus the whole 0x14..=0x1f block, 0x15 included) as raw-byte marker pairs; a naivechar < ' 'filter re-materialized them downstream. The normalizer decodes marker pairs and drops the artifact bytes.[Atails never leak into the buffer.Tests
New
tests/issue434_bridge_control_byte_regressions.rs(7 tests, all green):hang:source:^Ushape) runs without hangingExisting input-layer suites verified:
issue419_console_repl_channel_regressions(8/8),marker_leak_golden(6/6), lib unit tests (624/624),cli_testsfailure set byte-identical to the pre-change baseline (pre-existing environment-dependent failures only; thepb10k_prompt_channel_regressions::interactive_prompt_renders_dirtrimmed_wfailure is likewise pre-existing on this branch).