Re: 'git log' escape symbols shown as ESC[33 and ESC[m

2014-02-04 Thread Jeff King
On Tue, Feb 04, 2014 at 05:24:55PM -0800, Yuri wrote: > I think the 'experimental' approach is simpler and better. > When the git command requiring pager is first run, git would run the > pager with some simple one line escape sequence, and see if sequence > is preserved. See how? If less's stdou

Re: 'git log' escape symbols shown as ESC[33 and ESC[m

2014-02-04 Thread Yuri
On 01/16/2014 17:47, Jeff King wrote: Are you using "less" as your pager (it is the default in git unless you have set your PAGER environment variable)? If so, do you have the "R" option set to pass through ANSI codes? Git will set this automatically in your "LESS" variable if you do not already

Re: 'git log' escape symbols shown as ESC[33 and ESC[m

2014-01-17 Thread Yuri
One other idea to handle this is at configuration phase. You can test more and less with every option used on every platform for each of them respectively. Test could run the command with the option, and check if it passes the given escape sequence. This would be reflected in config.h defines l

Re: 'git log' escape symbols shown as ESC[33 and ESC[m

2014-01-16 Thread Jeff King
On Thu, Jan 16, 2014 at 09:35:48PM -0500, Jeff King wrote: > I think we should make an effort to set MORE=R on FreeBSD. We can > perhaps just set it unconditionally, and assume that primitive "more" > will ignore it. And then assume that "more" will handle colors (either > because of the R setting

Re: 'git log' escape symbols shown as ESC[33 and ESC[m

2014-01-16 Thread Yuri
On 01/16/2014 18:32, Jeff King wrote: Ah, if "more" can handle the colors, then that is preferable. I do think it would have to be system-specific, though. Unlike "less", there are many implementations of "more", and quite a lot of them will probably not support colors. We can make it a build-ti

Re: 'git log' escape symbols shown as ESC[33 and ESC[m

2014-01-16 Thread Jeff King
On Thu, Jan 16, 2014 at 06:29:21PM -0800, Jonathan Nieder wrote: > > + /* > > +* We know that "more" does not pass through colors at all. > > +*/ > > + if (!strcmp(pager, "more")) > > + return 0; > > I seem to remember that on some systems "more" is the name of the > full-fe

Re: 'git log' escape symbols shown as ESC[33 and ESC[m

2014-01-16 Thread Jeff King
On Thu, Jan 16, 2014 at 06:28:10PM -0800, Yuri wrote: > On 01/16/2014 18:13, Jeff King wrote: > >Interesting. I take it that "more" does not pass through ANSI codes at > >all, then. > > Actually, 'more -R' also passes colors on FreeBSD. So maybe you can > always add -R if PAGER=more on *BSD (any

Re: 'git log' escape symbols shown as ESC[33 and ESC[m

2014-01-16 Thread Jonathan Nieder
Hi, Jeff King wrote: > Obviously that does not help the "new unchanged user". I think we can > be smarter about guessing whether the pager can actually handle color, > based on the name. [...] > +++ b/pager.c > @@ -182,3 +182,38 @@ int check_pager_config(const char *cmd) [...] > + /* > +

Re: 'git log' escape symbols shown as ESC[33 and ESC[m

2014-01-16 Thread Yuri
On 01/16/2014 18:13, Jeff King wrote: Interesting. I take it that "more" does not pass through ANSI codes at all, then. Actually, 'more -R' also passes colors on FreeBSD. So maybe you can always add -R if PAGER=more on *BSD (any of them) ? This will fix this issue. I know, it is unpleasan

Re: 'git log' escape symbols shown as ESC[33 and ESC[m

2014-01-16 Thread Jeff King
On Thu, Jan 16, 2014 at 06:02:24PM -0800, Yuri wrote: > On 01/16/2014 17:47, Jeff King wrote: > >Are you using "less" as your pager (it is the default in git unless you > >have set your PAGER environment variable)? If so, do you have the "R" > >option set to pass through ANSI codes? Git will set t

Re: 'git log' escape symbols shown as ESC[33 and ESC[m

2014-01-16 Thread Yuri
On 01/16/2014 17:47, Jeff King wrote: Are you using "less" as your pager (it is the default in git unless you have set your PAGER environment variable)? If so, do you have the "R" option set to pass through ANSI codes? Git will set this automatically in your "LESS" variable if you do not already

Re: 'git log' escape symbols shown as ESC[33 and ESC[m

2014-01-16 Thread Jeff King
On Thu, Jan 16, 2014 at 04:34:01PM -0800, Yuri wrote: > When I run 'git log' on FreeBSD-9.2, I get output like this: > ESC[33mcommit 398e78c62fd507a317de7c2abb8e25c9fac7ac9eESC[m > Merge: 5fb8f6e d2138ba > ... > > ESC is white on black background. > > Why ESC[33m aren't expanded by the terminal?