Repository navigation
fix: honor custom prompt regexp semantics (v0.1.1) - #15
Merged
Merged
Conversation
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.
Why
Custom prompt expressions in v0.1.0 were required to cover the entire normalized line, even when the caller provided an unanchored regexp. This changes ordinary Go regexp semantics and forces adapters such as Koko to add
.*wrappers to restore in-line matching.Changes
Regexp.Matchfor username, password, shell, failure, password-change, and continuation prompts.(?i), and scoped regexp flags without rewriting the expression.^login:$expression.Koko integration
After upgrading its dependency to a version containing this fix, Koko's new adapter can pass compiled custom patterns directly and remove the
.*compatibility wrapper. It should retain its explicit legacy-default fallback and rejection of configurations that match the empty string. Those application configuration policies do not move into this library.This PR validates the library-side contract; it does not claim to have tested or modified Koko's separate, unpushed adapter changes.
Release intent
This PR updates
VERSIONand the changelog tov0.1.1. Merging it intomasterstarts the existing release workflow; publication proceeds only after the release checks pass. Creating or updating the PR does not publish.Callers that depended on v0.1.0's implicit whole-line restriction should add explicit
^and$anchors.Validation
go test -race -timeout=3m ./...andgo vet ./...passed.VERSION=v0.1.1;git diff --checkpassed.3e6a5dc1d03c2b167c560c5a2b25b407195b1900: Linux/Windows × Go 1.20.x/stable and the six-platform release snapshot. The race tests, vet, Linux PTY/TCP checks, archive checksums, and extracted Linux CLI smoke checks passed.