fix(hooks): 🐛 repair post-create hook execution, output rendering, and launch - #37
Open
CarmeloCampos wants to merge 2 commits into
Open
fix(hooks): 🐛 repair post-create hook execution, output rendering, and launch#37CarmeloCampos wants to merge 2 commits into
CarmeloCampos wants to merge 2 commits into
Conversation
CarmeloCampos
added a commit
to CarmeloCampos/opencode-worktree
that referenced
this pull request
Aug 12, 2026
Merged via local test branch to combine PRs arturosdg#35 arturosdg#36 arturosdg#37 arturosdg#38 for a single build.
CarmeloCampos
added a commit
to CarmeloCampos/opencode-worktree
that referenced
this pull request
Aug 12, 2026
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.
Summary
The post-create hook system was broken end-to-end: hook output corrupted the TUI, and the worktree selector never launched after a successful hook (the screen stayed stuck).
Changes
src/hooks.tssetEncoding) so multibyte characters are not corrupted across chunk boundaries.error+closeno longer double-fire).taskkill /t /fon Windows. No output/completion after abort.normalizeHookOutput: strips ANSI/VT/OSC escape sequences (stripVTControlCharacters) and applies carriage-return overwrite + CRLF semantics for progress output.src/ui.tsbun install && codegraph init && codegraph index && codegraph sync) no longer corrupt the frame or accumulate unboundedly.hideHookOutput()now returns the pending worktree path before clearing it; success, "open anyway", cancel, and Ctrl+C abort all capture the path first — the launch command now runs in the correct worktree and the dead/stuck UI is gone.ENTERinstead ofCHANGE— OpenTUI 0.1.75 emitsCHANGEonblur(), so pressingEscwas silently creating worktrees/branches.opencode.test/hooks.test.ts+"test": "bun test"scriptVerification
bun test— 11 passbunx tsc --noEmit— only pre-existing@opentui/coremodule-resolution errors (present on cleanmain)bun run build:single— builds cleanlyOut of scope
errorhandling — pre-existing, can follow up separately.