On Friday, 23 October 2015 16:35:27 UTC+1, Jonas Bernoulli  wrote:
> Robin Green <gree...@gmail.com> writes:
> 
> > I have installed overcommit[1] as a pre-commit hook. It outputs ANSI
> > escape sequences to set colors, and these are rendered as follows in
> > the magit-process buffer:
> >
> > I am not sure who is at fault here. overcommit appears to be doing the
> > right thing by testing whether its output is a tty, at least at a
> > quick glance at its code. Maybe magit is telling git not to output
> > colors, but still communicating with git using a pseudoterminal, so
> > that git hook scripts believe they are running in a terminal?
> 
> Magit by default indeed uses tty when running Git (see
> `magit-process-connection-type') but it does *not* tell Git to not color
> the output explicitly (see `magit-git-global-arguments'), so Git must be
> figuring it out itself.
> 
> We do have to use a tty because otherwise we cannot read the password
> from the user.  On Windows we have to hack around this, so to avoid
> having to do that for other platforms, we will keep using a tty by
> default.
> 
> You should probably ask for an `overcommit' option or setting which can
> be used to tell it not to color the output.

Alternatively, could we not do something similar to:

http://www.emacswiki.org/emacs/AnsiColor

>From a quick look at the magit code I couldn't find an equivalent to 
>`comint-output-filter-functions`, though.

-- 
You received this message because you are subscribed to the Google Groups 
"magit" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to magit+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to