Skip to content

fix: allow interactive prompts to access terminal#4

Merged
timvw merged 1 commit into
mainfrom
fix/shell-function-interactive-mode
Nov 29, 2025
Merged

fix: allow interactive prompts to access terminal#4
timvw merged 1 commit into
mainfrom
fix/shell-function-interactive-mode

Conversation

@timvw
Copy link
Copy Markdown
Owner

@timvw timvw commented Nov 29, 2025

Summary

Fixes the hanging issue with interactive selection commands (wt co, wt rm, wt pr, wt mr).

Problem

The shell function wrapper was capturing all output with output=$(command wt "$@"), which broke promptui's interactive selection by preventing it from accessing the terminal directly.

Solution

Modified the shell function to detect when commands need interactive mode (single argument matching co|checkout|rm|remove|pr|mr) and execute them directly without output capture, while still maintaining auto-cd functionality for commands with arguments.

Test plan

  • Verify wt co shows interactive branch selector
  • Verify wt rm shows interactive worktree selector
  • Verify wt pr shows interactive PR selector (requires gh CLI)
  • Verify wt mr shows interactive MR selector (requires glab CLI)
  • Verify wt create foo still auto-navigates to worktree directory
  • User needs to reload shell integration after merge: source ~/.zshrc

🤖 Generated with Claude Code

@codecov
Copy link
Copy Markdown

codecov Bot commented Nov 29, 2025

Codecov Report

❌ Patch coverage is 0% with 11 lines in your changes missing coverage. Please review.
✅ Project coverage is 7.28%. Comparing base (9bb5b2a) to head (73c00d5).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
main.go 0.00% 11 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff            @@
##            main      #4      +/-   ##
========================================
- Coverage   7.49%   7.28%   -0.21%     
========================================
  Files          1       1              
  Lines        387     398      +11     
========================================
  Hits          29      29              
- Misses       357     368      +11     
  Partials       1       1              
Files with missing lines Coverage Δ
main.go 7.28% <0.00%> (-0.21%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

The shell function wrapper was capturing output which broke promptui's
interactive selection for commands like 'wt co', 'wt rm', 'wt pr', 'wt mr'.

Now detects when these commands are run without arguments and executes
them directly without output capture, preserving terminal access for
interactive prompts while still maintaining auto-cd functionality for
commands with arguments.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@timvw timvw force-pushed the fix/shell-function-interactive-mode branch from cefa1ad to 73c00d5 Compare November 29, 2025 15:23
@timvw timvw merged commit bde2424 into main Nov 29, 2025
8 checks passed
@timvw timvw deleted the fix/shell-function-interactive-mode branch November 29, 2025 15:27
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