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

Ertugrul Söylemez ertesx at gmx.de
Fri Jan 2 13:33:48 CET 2015


Hi Michael,

> When I explicitly launch man, I am going to read the top of the man
> page and some place in the middle, so "less" is useful.

Absolutely, `man` is supposed to be an interactive program, and it
usually displays formatted text that wouldn't fit on one page anyway.
But honestly I wouldn't even mind if `man` just dumped everything on
stdout.  Since we have a Unix-like system I can easily set my shell up
to pipe its output through PAGER by default.


> When I launch some nix build-related tool I expect to monitor current
> progress, and read the last 50 lines if something fails (something
> like tail -f, but for a stream).

Your terminal emulator does exactly that.  People, especially text-based
UX programmers, often forget that there is a terminal that displays
everything, and that the terminal is a non-trivial piece of software
that offers everything you need to view long output, etc.

You only really need an additional program when you need to save the
output to a file, but nix-build writes build logs by itself anyway.


> But the PAGER really matters for man, so I keep it set to 'less -R'
> anyway.

And then a command like the following uses it as well:

    nix-env --list-generations

I'm mostly only interested in the last few lines, so just printing
everything to stdout would be the correct solution for me.


> The original poster probably has other motivations and workflow
> patterns, but that's my experience.

I think I have similar workflow patterns, but my point is that Nix 1.8
makes assumptions on the workflow patterns, and that's horrible.  It
helps ruining the world of UX, slowly, piece by piece.

Systemd makes the same assumptions.  That's why invoking most systemd
commands is a horrible experience.  Either I write `--no-pager` with
every command, or I have to live with the fact that they abuse PAGER and
my output disappears when I press `q`, when all they should really do is
to print to stdout.  That's what stdout is for after all!

Assumptions ruin the world.


Greets,
Ertugrul


More information about the nix-dev mailing list