git-up icon indicating copy to clipboard operation
git-up copied to clipboard

control codes are output to non-tty's

Open Byron opened this issue 11 years ago • 2 comments

In order for git-up to set the terminals color, special codes have to be emitted to stdout. This is fine, as long as stdout is connected to a tty.

If the command is executed from, say, sublime text, the output will be a standard pipe, and sublime will display the control characters as 'weird letters'.

error: Could not fetch origin
[31m`git fetch` failed[0m

A possible solution would be to check whether or not stdout is a tty.

Byron avatar Jun 05 '14 15:06 Byron

This gist might be of help: https://gist.github.com/timuruski/6072363

msiemens avatar Jun 05 '14 15:06 msiemens

I think this should be checked in the colored library.

See defunkt/colored#4.

kpcyrd avatar Jun 30 '14 16:06 kpcyrd