[Nix-dev] less: When assumptions ruin the world

Ertugrul Söylemez ertesx at gmx.de
Fri Jan 2 12:37:01 CET 2015


Hi Vladimír,

> If you set PAGER=cat or PAGER="" you get pretty much the old behavior.
> Also, if the output isn't a terminal, less isn't used, e.g. ``nix-env -q
> | cat`` or ``nix-env -q | grep foo`` works the old way for me.

I'm aware of that, and it's a terrible solution.  I want to have
PAGER=less for other programs, I just don't want Nix to use the pager.
`nix-env -q` using the pager has already been trouble for me, but now
even things like `--list-generations` use it.


> I see no harm in having the option.

It's not an option.  It's builtin and enforced behaviour since Nix 1.8.
And it annoys me to such an extent that I'm almost willing to fork Nix
and remove this "option", or to write a command-line front-end to Nix,
because Nix is no longer a command line program.  It has become an
interactive program.

Think about it:  Do you want `ls` or `find` to force-use the pager?  Do
you want to opt out by setting PAGER to something that isn't a pager?
Or by piping every invocation of them through `cat`?

If you really want interactive behaviour, there should be an interactive
frontend.


> Most importantly, people can choose their preferred way of displaying
> long output with one variable common to many programs, which IMO
> rather helps those with special needs (blind; or e.g. PAGER=tail if
> you always want the end, etc.).

No, they can't choose.  I would choose to use `less` as a pager when I
need it, and otherwise I would use my terminal.  I can't make that
choice without corrupting the PAGER variable (which I use for other
things!).


Greets,
Ertugrul


More information about the nix-dev mailing list