You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Bug: multi-line post:open script collapsed to single line #26
When a user writes post:open using a TOML triple-quoted multi-line string:
"post:open" = """#!/usr/bin/env bashpnpm i --frozen-lockfile --prefer-offlinecargo buildclaude --dangerously-skip-permissions "pull from main and work on issue: {{issue}} and pr to main"echo "Worktree ready: {{owner}}/{{repo}}#{{issue}} ({{branch}})""""
the runner collapses it to a single escaped line before passing it to the shell:
#!/usr/bin/env bash\npnpm i --frozen-lockfile --prefer-offline\ncargo build\n...
The shell receives this as one line, so only the shebang runs; the remaining commands are silently ignored.
Expected behavior
Multi-line hook scripts should execute with newlines preserved — identical to writing them as single-line strings with explicit \n escapes.
Steps to reproduce
Add "post:open" as a triple-quoted multi-line value in ~/.config/worktree-runner/config.toml.
Run worktree open <issue>.
Observe that only the first line of the script executes.
Possible fix
The TOML parser already delivers the string with real newline characters. The bug is downstream — likely in how the script is passed to sh -c or written to a temp file. Ensure the raw string (with real \n characters) is used rather than a debug/display representation.
Activity
github-actions commentedon Feb 23, 2026
A workspace is ready for this issue.
Powered by Worktree · Install
chore: migrate issue #27 to GitHub (#26)
fix: preserve multi-line hook scripts and add Ghostty terminal support
test(hooks): add regression test for multi-line hook execution
test(hooks): add regression test for multi-line hook execution (#29)
chore: migrate issue #27 to GitHub (#26)
test(hooks): add regression test for multi-line hook execution
feat(assets): add social preview image and 460px avatar for GitHub (#26)
chore(centy): close issue #26 - social preview and avatar assets added
feat(assets): add social preview image and 460px avatar for GitHub (#26)
chore(centy): close issue #26 - social preview and avatar assets added
Merge pull request #38 from worktree-io/issue-26