Created
March 5, 2026 10:03
-
-
Save hipertracker/de19bbd4b2d01983066f5858b3bf7bd1 to your computer and use it in GitHub Desktop.
Claude Code hangs in Ghostty terminal (macOS) — PTY detection workaround for -p/--print flags
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
| if [[ "$TERM_PROGRAM" == "ghostty" ]]; then | |
| claude() { | |
| if [[ "$*" == *"-p"* || "$*" == *"--print"* ]]; then | |
| if [ -t 0 ]; then | |
| # stdin to TTY (brak pipe) — użyj /dev/null | |
| command claude "$@" </dev/null | |
| else | |
| # stdin to pipe — przepuść normalnie | |
| command claude "$@" | |
| fi | |
| else | |
| command claude "$@" | |
| fi | |
| } | |
| fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment