Skip to content

fix(hook): use tee-based capture instead of PTY proxy#14

Merged
moukrea merged 1 commit intomainfrom
fix/hook-tee-capture
Apr 13, 2026
Merged

fix(hook): use tee-based capture instead of PTY proxy#14
moukrea merged 1 commit intomainfrom
fix/hook-tee-capture

Conversation

@moukrea
Copy link
Copy Markdown
Owner

@moukrea moukrea commented Apr 13, 2026

Summary

The previous fix (#13) tried to fix hook-induced terminal issues by tweaking the PTY proxy — that approach was wrong and broke colors. This PR takes the correct approach: eliminate the PTY proxy entirely for hooked sessions.

The hook (eval "$(snag hook bash)") was using exec snag wrap to interpose a PTY proxy between the terminal and the shell. This broke the terminal's direct relationship with the shell process, causing:

The fix: replace exec snag wrap --capture <path> with exec > >(tee -a <path>) 2>&1 — the same tee-based capture mechanism that adopted sessions already use. This keeps the shell as the terminal's direct child process, preserving all terminal integration (titles, CWD tracking, colors, VTE hooks).

Also reverts all cmd_wrap changes from #13 (login shell, SHLVL, OSC 7 parsing, removed title) to restore its original behavior for direct usage.

@moukrea moukrea merged commit 4de78b2 into main Apr 13, 2026
4 checks passed
@moukrea moukrea deleted the fix/hook-tee-capture branch April 13, 2026 21:19
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.

1 participant