All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kevin Daudt <me@ikke.info>
To: "Randall S. Becker" <rsbecker@nexbridge.com>
Cc: 'Junio C Hamano' <gitster@pobox.com>, 'Jeff King' <peff@peff.net>,
	'The Grey Wolf' <greywolf@starwolf.com>,
	git@vger.kernel.org
Subject: Re: ANSI sequences produced on non-ANSI terminal
Date: Sat, 25 Sep 2021 08:45:28 +0200	[thread overview]
Message-ID: <YU7FiMwLYdrhSc0P@alpha> (raw)
In-Reply-To: <038801d7b0c6$f9345a90$eb9d0fb0$@nexbridge.com>

On Thu, Sep 23, 2021 at 06:04:20PM -0400, Randall S. Becker wrote:
> On September 23, 2021 5:55 PM, Junio C Hamano wrote:
> >Jeff King <peff@peff.net> writes:
> >
> >> On Wed, Sep 22, 2021 at 10:21:22PM -0700, The Grey Wolf wrote:
> >>
> >>> Anything else you want to add:
> >>> 	I searched google and the documentation as best I was able for
> >>> 	this, but I am unable to find anywhere that will let me disable
> >>> 	(or enable) colour for a particular term type.  Sometimes I'm on
> >>> 	an xterm, for which this is GREAT.  Sometimes I'm on a Wyse WY60,
> >>> 	for which this is sub-optimal.  My workaround is to disable colour
> >>> 	completely, which is reluctantly acceptable, but it would be nice
> >>> 	to say "If I'm on an xterm/aterm/urxvt/ansi terminal, enable
> >>> 	colour or cursor-positioning, otherwise shut it off."  If this
> >>> 	seems too much of a one-off to handle, fine, but most things that
> >>> 	talk fancy to screens are kind enough to allow an opt-out based on
> >>> 	terminal type. :)
> >>
> >> Git doesn't have any kind of list of terminals, beyond knowing that
> >> "dumb" should disable auto-color. It's possible we could expand that
> >> if there are known terminals that don't understand ANSI colors. I'm a
> >> bit wary of having a laundry list of obscure terminals, though.
> >>
> >> If we built against ncurses or some other terminfo-aware library we
> >> could outsource that, but that would be a new dependency. I'm hesitant
> >> to do that even as an optional dependency given the bang-for-the-buck
> >> (and certainly making it require would be right out).
> >
> >I was wondering if Gray Wolf can run screen on the Wyse, and then wouldn't git see TERM=screen which is pretty much ANSI if I am
> not
> >mistaken ;-)?
> 
> Would something like switch in .gitconfig make a difference? Like core.colourize=false. There are situations where SSH sessions come
> in from automation, like Jenkins and Travis, which sets term to something other than dumb by default. Coloring makes a mess of the
> output. The ability to turn off colouring off by user might be helpful.
> 
> -Randall
> 

That already exists: `color.ui`:

> This variable determines the default value for variables such as
> color.diff and color.grep that control the use of color per command
> family.
> [..]
> Set it to false or never if you prefer Git commands not to use color
> unless enabled explicitly with some other configuration or the --color
> option.

Kevin

  reply	other threads:[~2021-09-25  6:46 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-23  5:21 ANSI sequences produced on non-ANSI terminal The Grey Wolf
2021-09-23 21:20 ` Jeff King
2021-09-23 21:54   ` Junio C Hamano
2021-09-23 22:04     ` Randall S. Becker
2021-09-25  6:45       ` Kevin Daudt [this message]
2021-09-24  0:58   ` [PATCH] config: add an includeIf.env{Exists,Bool,Is,Match} Ævar Arnfjörð Bjarmason
2021-09-24 21:07     ` Jeff King
2021-09-24 21:28       ` Junio C Hamano
2021-09-24 21:59         ` Jeff King
2021-09-27 16:30           ` Junio C Hamano
2021-09-27 20:15             ` Jeff King
2021-09-27 20:53               ` Randall S. Becker
2021-09-27 21:37                 ` Jeff King
2021-09-27 21:56                   ` Randall S. Becker
2021-09-27 23:52               ` Ævar Arnfjörð Bjarmason
2021-09-28  0:41                 ` Jeff King
2021-09-28  2:42                   ` Ævar Arnfjörð Bjarmason
2021-09-28  5:42                     ` Jeff King
2021-09-28 19:28                       ` Ævar Arnfjörð Bjarmason
2021-09-28  0:24               ` Junio C Hamano
2021-09-24 23:57   ` ANSI sequences produced on non-ANSI terminal Greywolf
2021-09-25  5:49     ` Jeff King
2021-10-01 23:17       ` Greywolf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YU7FiMwLYdrhSc0P@alpha \
    --to=me@ikke.info \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=greywolf@starwolf.com \
    --cc=peff@peff.net \
    --cc=rsbecker@nexbridge.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.