Repository navigation
fix: preserve terminal stderr for ticket pickers - #39
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes Reviewed all seven changed files, including subprocess descriptor handling, failure diagnostics, and the terminal regression tests.
- Terminal inheritance: Ticket commands receive terminal stderr directly, preserving terminal identity and dimensions while stdout remains reserved for JSON.
- Diagnostic handling: Redirected stderr and injected writers retain streaming and capture; terminal failures avoid repeating unrelated stdout and preserve wrapped subprocess errors.
- Regression coverage: Real Bubble Tea PTY tests exercise selection and cancellation, and a hermetic CLI test verifies branch creation and persisted ticket metadata. The specification and dependencies reflect the new coverage.
Verification passed on Linux: mise exec -- go test ./..., mise exec -- go vet ./..., and five race-enabled repetitions of the ticket-command tests. macOS and live Herdr behavior were not independently exercised during this review.
gpt-6.1-sol | 𝕏
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.

Motivation
Interactive ticket pickers can render a blank screen because HWT turns stderr into a pipe. Preserve terminal stderr so pickers work without a
2>/dev/ttyshell wrapper.Summary of changes
Testing
To verify manually, configure a picker as direct argv, such as
[lnr, issue, search, --json, '{input}'], and runhwt create --ticket --jsonin Herdr. Confirm the picker renders, Enter creates the selected branch with ticket metadata, and Escape cancels without creating a worktree. Redirect stdout to a file to confirm no UI appears in the JSON.Verified in a live Herdr pane with fake ticket data and a disposable repository: the picker received real dimensions, Enter created a real Herdr workspace/worktree, metadata persisted, and Escape preserved the picker exit status. Test workspace and pane were removed.
Also passed the full
mise run check, 20 repeated macOS race-enabled ticket-command test runs, 20 repeated Linux container test runs, and 10 repeated ticket E2E runs.Dependencies/special considerations
github.com/creack/ptyfor tests and uses the existing cross-platform terminal library directly.Flockcalls ininternal/localdns/localdns.go.