Skip to content

Instantly share code, notes, and snippets.

@hipertracker
Created March 5, 2026 10:03
Show Gist options
  • Select an option

  • Save hipertracker/de19bbd4b2d01983066f5858b3bf7bd1 to your computer and use it in GitHub Desktop.

Select an option

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
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