From f443715c8f52440ff83af85991f0687f37e41929 Mon Sep 17 00:00:00 2001 From: Amolith Date: Sun, 18 Jan 2026 11:06:43 -0700 Subject: [PATCH] feat(hooks): forward run hook stdout to user Allows hooks to emit reminders or messages during worktree creation. Assisted-by: Claude Opus 4.5 via Amp --- src/wt/hooks.lua | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/wt/hooks.lua b/src/wt/hooks.lua index 5ed86d57bbd66c59a7806c9fdb5f8b3336a20fc8..2ecfc08947d8cfae2a4262819268369454d68bf6 100644 --- a/src/wt/hooks.lua +++ b/src/wt/hooks.lua @@ -164,7 +164,13 @@ function M.run_hooks(source, target, hooks, root, home_override) end if hooks.run then for _, cmd in ipairs(hooks.run) do - local _, code = run_cmd("cd " .. target .. " && " .. cmd) + local output, code = run_cmd("cd " .. target .. " && " .. cmd) + if output ~= "" then + io.write(output) + if not output:match("\n$") then + io.write("\n") + end + end if code ~= 0 then io.stderr:write("warning: hook command failed: " .. cmd .. "\n") end