Skip to content

Read complete prompt input lines - #22

Merged
inhere merged 1 commit into
gookit:mainfrom
rupayon123:fix/read-complete-prompt-lines-20261031
Nov 1, 2026
Merged

inhere merged 1 commit into
gookit:mainfrom
rupayon123:fix/read-complete-prompt-lines-20261031

Conversation

@rupayon123

Copy link
Copy Markdown
Contributor

ReadLineWithOutput currently ignores bufio.Reader.ReadLine's isPrefix result. Input longer than its buffer is returned as several answers, which can split UTF-8 and shift the next prompt response.

Accumulate fragments until the physical line ends. An unterminated final line is returned once before EOF; real non-EOF input errors still propagate. Trimming, CRLF and the cached reader remain unchanged.

Validation with Go 1.26.0 on macOS arm64:

  • Seven failing cases and four controls now pass, including exact 4096/8192-byte final lines and an actual io.Pipe error.
  • Full suite: 263 passing leaf cases across 16 packages. Affected interact/internal race checks: 117 passing cases across six packages.
  • Vet, build, gofmt, tidy/module-lock checks and Staticcheck pass.
  • Native subprocesses with actual piped stdin and the independent boundary probes return complete answers followed by stable EOF.

Supplementary whole-repository race testing has an unchanged progress.TestMultiProgressAutoRefreshMarksDirty failure, reproduced narrowly on the pristine base. This patch changes only the input helper and its regressions. Hosted platforms and terminal-event backends remain separate from these stream checks.

@inhere
inhere merged commit f053f5c into gookit:main Nov 1, 2026
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.

2 participants