[Nix-dev] less: When assumptions ruin the world
Michael Raskin
7c6f434c at mail.ru
Fri Jan 2 13:40:40 CET 2015
>> 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.
I know; I was answering the question of why it is a problem to choose
a single PAGER value.
>> 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.
I use ls instead of this command.
>> 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!
Well, systemd is intentionally breaking my workflow in ways that cannot
be worked around with trivial shell scripts, and I don't care what pager
journalctl when it takes multiple minutes to do the job that "tail -f"
does in tens of milliseconds.
So I let's not compare oversight with malice..
More information about the nix-dev
mailing list