Skip to content

Commit bde2424

Browse files
authored
Merge pull request #4 from timvw/fix/shell-function-interactive-mode
fix: allow interactive prompts to access terminal
2 parents 9bb5b2a + 73c00d5 commit bde2424

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)