Repository navigation
Fix defects found in a full audit of 1.3.0 - #134
Merged
Merged
Conversation
profiles list, show, validate and test each read a fixed number of arguments and dropped the rest without a word, so `profiles validate good.yml broken.yml` reported success having read only the first file. A surplus argument is now a usage error that names it.
An input that ended before its first byte returned ahead of the --show-profile and --benchmark reports, so both flags printed nothing for an empty file or a command with no output.
Another program can leave O_NONBLOCK set on the pipe or terminal that prismtty inherits as stdin. The first read of an empty one then failed with EAGAIN and the filter exited 1 before any input arrived. Stdin now goes through the same wait-when-would-block wrapper as stdout.
profiles test printed its fixture through the highlighter without the escape filtering the two flags ask for, so an OSC 52 clipboard write in a captured fixture still reached the terminal under --sanitize, and --strip-ansi left the capture's own colors in place.
The reload marker and pid files were opened for writing before their file type was checked. A FIFO at that path with no reader made the open block, so `prismtty --reload` hung forever. The open is now non-blocking, and the existing regular-file check refuses the rest.
The tracker of the program's own rendition read any CSI ending in `m` as SGR and skipped the parameters it could not parse. xterm's modifyOtherKeys control (`CSI > 4 ; 1 m`, sent by fish, vim and tmux) therefore counted as bold, and the text after each highlight was redrawn bold or faint. A control with a private marker or an intermediate byte is no longer SGR, and a C0 control inside the CSI is no longer taken for part of its parameters.
A terminal runs a line feed or carriage return it meets inside a CSI. strip_ansi dropped them with the control, which joined the lines around an escape cut short at a line end.
An exclusive rule marked each span protected as soon as it styled it, so its own later groups were skipped where they overlapped: with colors on groups 0 and 1, group 1 was dropped. Its spans are now protected from later rules once all of its groups are applied.
Removing a prompt's own color took every CSI ending in `m` on the line with it. xterm's key modifier option (`CSI > 4 ; 1 m`, XTMODKEYS) was deleted from the stream that way, so the terminal never changed how it reports keys. One predicate now decides what an SGR is for both the rendition tracker and this removal.
An arrow or function key sent in application mode (`ESC O A`, `ESC O P`) had only its ESC skipped, so --local-echo printed the rest of the key as `OA` or `OP`.
--trace-io checked the file's type, owner and mode but not its link count, so a trace path that was a hard link appended the session's input and output to the file's other name.
A numeric capture key was narrowed with `as usize`. On a 32-bit target 4294967296 wrapped to group 0 and colored the whole match instead of being rejected like the quoted form of the same key.
- generic: a good-state word after `not` (`not reachable`, `not connected` with aligned spacing, `not valid`) was painted green; `not reachable` now reads as a bad state like `not connected`. - generic: bare `den` (a site code, a word) was painted as a denial. - generic: an IPv6 zone holding `-`, `.` or `_` was split in two colors. - arubacx, fortinet: configuration-context prompts were left uncolored. - palo-alto: aggregate interfaces (`ae1`, `ae1.107`) were left uncolored.
The --strip-ansi fix for a line feed inside a CSI left the same hole for a plain escape: `line1 ESC CR LF next` still lost its line break.
Strong and negative signals were plain substring searches, so ordinary output selected a vendor profile: `rhel` inside `ServerHello` chose linux-unix, `ios xe` inside `BIOS XE` and `asa version` inside `NASA version` chose cisco, `pan-os` inside `japan-osaka` chose palo-alto. A signal that starts or ends with a word character may no longer continue a word on that side.
The privacy scan ran its IPv6 check over whole `path:line:content` records, so the line number joined an address that began the line: a documentation address there was rejected, and a real one could be read as a different address. The path and the content are now checked on their own. The IPv4 check skipped zero-padded octets, which devices print and which name the same address.
The test literal held a real local account name, against the synthetic-fixtures rule, and shipped in the published crate source.
- CI now runs `cargo package --locked`, so a file missing from the crate's include list fails a pull request instead of a release tag. - The READMEs said each archive contains its checksum; it is a separate file. They now also name the PCRE2 runtime requirement. - The hero output has six lines but only five had a delay, so the sixth animated first. - CONTRIBUTING named a sidecar file that does not exist.
Requiring a word boundary on both sides lost real banners where the vendor glues a model or version on (`Nexus9000`, `rhel9`, `FortiGateRugged`). Only the start has to begin a word; that is what separates `rhel` from `ServerHello`. Adds a positive case for every vendor profile.
inxbit
marked this pull request as ready for review
November 17, 2026 07:28
This was referenced Nov 17, 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.
Fixes for defects found in a full audit of 1.3.0. Each fix has a regression test that failed first, except the capture-index cast (32-bit only).
Behavior changes to know about
profiles list|show|validate|testnow reject surplus arguments.profiles validate good.yml broken.ymlused to report success having read only the first file.strip_ansi(library) and--strip-ansikeep the format effectors (backspace through carriage return) found inside a CSI or a plain escape, as a terminal runs them. They used to be dropped with the control, which joined the lines around an escape cut short at a line end.rhelinsideServerHellono longer selects linux-unix.Fixed
mcounted as SGR. xterm's key modifier option (CSI > 4 ; 1 m, XTMODKEYS) was tracked as bold, so text after each highlight was redrawn bold or faint, and it was deleted from the stream when a prompt's colors were neutralized.profiles testignored--sanitizeand--strip-ansi, so an OSC 52 in a captured fixture reached the terminal.--show-profileand--benchmarkprinted nothing for an empty input.prismtty --reloadhung on a FIFO in place of the reload marker.--local-echoechoed the tail of SS3 keys (ESC O AprintedOA).--trace-ioaccepted a file with a second hard link.as usize.Profiles
notis no longer green; baredenis no longer a denial; an IPv6 zone with-,.or_stays one address.ae1,ae1.107) are colored.Release and QA
cargo package --locked).Verification
cargo fmt --check,cargo clippy --all-targets --all-features -- -D warnings,cargo test --locked,node --test tests/*.test.mjs,scripts/privacy-scan.sh,cargo package --locked.--strip-ansi, no string control left by--sanitize, bytes preserved in default mode.