fix: allow interactive prompts to access terminal#4
Merged
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ 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
🚀 New features to boost your workflow:
|
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>
cefa1ad to
73c00d5
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
wt coshows interactive branch selectorwt rmshows interactive worktree selectorwt prshows interactive PR selector (requiresghCLI)wt mrshows interactive MR selector (requiresglabCLI)wt create foostill auto-navigates to worktree directorysource ~/.zshrc🤖 Generated with Claude Code