Skip to content

Fix shell integration output to write to stdout#3

Merged
agarcher merged 2 commits intomainfrom
shell-integration
Jan 11, 2026
Merged

Fix shell integration output to write to stdout#3
agarcher merged 2 commits intomainfrom
shell-integration

Conversation

@agarcher
Copy link
Owner

Summary

  • Fix wt init <shell> to write to stdout instead of stderr, so eval "$(wt init zsh)" works correctly
  • Cobra's cmd.Print() uses OutOrStderr() by default, so switched to fmt.Fprint(cmd.OutOrStdout(), ...)
  • Added local testing documentation to README

Test plan

  • make test passes
  • Verify ./build/wt init zsh > /tmp/out.txt 2> /tmp/err.txt puts output in out.txt
  • Verify eval "$(./build/wt init zsh)" properly defines the wt function

🤖 Generated with Claude Code

agarcher and others added 2 commits January 10, 2026 19:07
The init command was using cmd.Print() which writes to stderr by default
in Cobra. Changed to fmt.Fprint(cmd.OutOrStdout()) so that eval "$(wt init zsh)"
works correctly. Also added local testing documentation to README.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Verifies that eval'ing the init script in zsh/bash actually defines
the wt function correctly. Skips if the shell is not available.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@agarcher agarcher merged commit 4c331e1 into main Jan 11, 2026
4 checks passed
@agarcher agarcher deleted the shell-integration branch January 11, 2026 00:17
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