Skip to content

Commit cefa1ad

Browse files
timvwclaude
andcommitted
fix: allow interactive prompts to access terminal in shell function
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>
1 parent d9f4c26 commit cefa1ad

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

main.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -624,6 +624,18 @@ This enables:
624624
- Tab completion for commands and branch names`,
625625
Run: func(cmd *cobra.Command, args []string) {
626626
fmt.Print(`wt() {
627+
# Check if command needs interactive mode (no args for co/checkout/rm/remove/pr/mr)
628+
if [ "$#" -eq 1 ]; then
629+
case "$1" in
630+
co|checkout|rm|remove|pr|mr)
631+
# Run interactively without capturing output
632+
command wt "$@"
633+
return $?
634+
;;
635+
esac
636+
fi
637+
638+
# Normal mode with output capture for auto-cd
627639
local output
628640
output=$(command wt "$@")
629641
local exit_code=$?

0 commit comments

Comments
 (0)