Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

STDOUT.tty? breaks pipes #8

Open
jimmycuadra opened this issue Feb 21, 2012 · 2 comments
Open

STDOUT.tty? breaks pipes #8

jimmycuadra opened this issue Feb 21, 2012 · 2 comments
Assignees

Comments

@jimmycuadra
Copy link

While writing a function to add Hitch info to my bash prompt, I was piping the output of hitch to cut, and wasn't getting any output. At first I thought I was doing something wrong in bash, but ultimately I discovered that Hitch.print_info is explicitly checking if STDOUT is a terminal and not outputting anything in that case. This prevents UNIX pipes from passing along the output of the command. Is there a reason this check is being made? Can it just be removed?

@therubymug
Copy link
Owner

At one point in time we had a hitch --info or --short that was used for this specific reason. It must have been lost in the major refactor I did a while back. I'll look into adding that back in for this.

@ghost ghost assigned therubymug Mar 19, 2012
@dbi
Copy link

dbi commented Sep 7, 2012

I use this bash function in my prompt

function hitch_pair {
  source ~/.hitch_export_authors
  if [ `git symbolic-ref HEAD 2> /dev/null` ] && [ -n "${GIT_AUTHOR_EMAIL:+1}" ]; then
    echo $GIT_AUTHOR_EMAIL|awk -F "[+@]" '{ print " "$2"+"$3 }'
  fi
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants