monotone-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Monotone-devel] colorization


From: Markus Wanner
Subject: Re: [Monotone-devel] colorization
Date: Mon, 13 Apr 2015 10:02:57 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.6.0

On 04/12/2015 09:15 PM, Timothy Brownawell wrote:
> Oops, I meant "other" as in "not monotone". With my example being "ls"
> (which I have the GNU coreutils version, on current Debian testing).

Oh, I see, that makes more sense, now. And yes, I agree, it's a good
idea to be consistent with other unix commands like ls, here.

>>> If --colorize is given explicitly, I'd think it should colorize
>>> regardless of what it thinks the output type is.
>> I see your point. And it seems that would be more consistent with how
>> '--ticker' works as well. I'll change that. Thanks for your input.

Changed and committed. Now, on a smart terminal, the following two are
equivalent:

    $ mtn diff
    $ mtn diff --colorize | less -FRX

>> The same argument could be applied for '--pager', though, where I have a
>> bit of a hard time coming up with a valid use case.
> 
> Hm... --pager in general is a bit odd really, but maybe I'm just too
> comfortable with unix pipelines.

Well, it IS a unix pipe at work, there. ;-)

Admittedly, that feature is inspired by git. The first time git offered
me a pager, I was surprised. By now, I'm so used to it that appending "|
less" to many of the mtn commands started to itch. I scratched.

> --pager means, send the output thru this other program instead of to
> normal STDOUT. Which does not make sense if STDOUT is being captured,
> which can be approximated by STDOUT not being a smart terminal.

Correct.

> It also doesn't make much sense to give --pager explicitly,

Exactly.

> since piping
> to your paging program does the same thing and is more consistent with
> the rest of the world. Unless you're on Windows I guess?

I'm not. Nor does this feature work on Windows, sorry. (Neither
colorization nor piping to a pager, to be specific.)

> That's a use case. Have --pager be a GUI program (notepad, whatever),
> which doesn't output thru your terminal. In which case you probably want
> it *especially* if your terminal isn't smart.

Such a program would need to be able to read from stdin, but not write
to stdout. AFAIUI emacsclient, for example, cannot do that. Are you
aware of any such program?

In any case, I also changed --pager to always, unconditionally pipe
through a pager program.

(More importantly, I should now make that pager program configurable.)

Regards

Markus


Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]