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

2015-01-03 Thread Alexander Kjeldaas
Just a note for those who are annoyed that less will clear the screen on quit. export LESS=-X On Fri, Jan 2, 2015 at 4:30 PM, Ertugrul Söylemez ert...@gmx.de wrote: Hi Eelco, There is a very good reason for this principle. If a program does more than what it's intended to do, then it

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

2015-01-02 Thread Vladimír Čunát
Hi. On 01/02/2015 02:36 AM, Ertugrul Söylemez wrote: since Nix 1.8 much of the output of nix commands is piped through `less`, which is certainly meant to be a convenience, but that convenience depends on a few assumptions: If you set PAGER=cat or PAGER= you get pretty much the old behavior.

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

2015-01-02 Thread Ertugrul Söylemez
Hi Charles, Perhaps suggesting shell aliases would be sufficient for those that may want the pager by default? Yes, that's a good solution. Greets, Ertugrul ___ nix-dev mailing list nix-dev@lists.science.uu.nl

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

2015-01-02 Thread Ertugrul Söylemez
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

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

2015-01-02 Thread Ertugrul Söylemez
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

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

2015-01-02 Thread Michael Jones
If it helps at all, git seems to use GIT_PAGER first and then falls back to PAGER and then to `less` for the commands that use it. Perhaps nix could respect a NIX_PAGER env var? To me it depends on the output of the command. I love that git pages the output of `git log` automatically but that is

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

2015-01-02 Thread Ertugrul Söylemez
Hi Paul, 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!). I'm not a fan of using less for nix tools. But it seems you're

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

2015-01-02 Thread Ertugrul Söylemez
Hi Michael, I know; I was answering the question of why it is a problem to choose a single PAGER value. Sorry, I'm still getting used to my new mail setup. =) nix-env --list-generations I use ls instead of this command. That's actually a good idea, thanks. Well, systemd is

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

2015-01-02 Thread Paul Colomiets
Hi, On Fri, Jan 2, 2015 at 1:37 PM, Ertugrul Söylemez ert...@gmx.de wrote: 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!).

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

2015-01-02 Thread Domen Kožar
My 2c: if Nix offers a way to disable the pager then I'd rather see 1% of users for such needs to make the bash alias instead of the other way around. On 2 Jan 2015 02:36, Ertugrul Söylemez ert...@gmx.de wrote: Hi everybody, since Nix 1.8 much of the output of nix commands is piped through

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

2015-01-02 Thread Ertugrul Söylemez
Hi Bjørn, Hm, I've never thought of automatic less as a misfeature before. I didn't have anything to do with its inclusion in nix, but I remember when I started using git that I was pleasantly surprised by it's use of less, which made git more fun to work with. (If I was a nix developer I

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

2015-01-02 Thread Luke Clifton
Forgot the list... On 02/01/2015 9:36 am, Ertugrul Söylemez ert...@gmx.de wrote: Feature request 1: Please do your part in saving the software world and remove this anti-feature. Don't even consider making it optional. It's useless. Remove it. In the future, whenever you think that

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

2015-01-02 Thread Bjørn Forsman
On 2 January 2015 at 14:01, Ertugrul Söylemez ert...@gmx.de wrote: [...] Of course all of this is my personal opinion. If the majority of the community disagrees, then I will have to live with it. I have opened this thread because I think that many people will actually agree. Hm, I've never

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

2015-01-02 Thread Bjørn Forsman
On 2 January 2015 at 14:21, Michael Raskin 7c6f4...@mail.ru wrote: So what's the best way forward? Using $NIX_PAGER first, as suggested by Michael Jones earlier in this thread? That should cover your use case, right? (_And_ preserve the current behaviour for people liking it interactive? Just in

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

2015-01-02 Thread Ertugrul Söylemez
Hi Domen, My 2c: if Nix offers a way to disable the pager then I'd rather see 1% of users for such needs to make the bash alias instead of the other way around. why do you insist on an interactive-by-default Nix? There should be an interactive frontend, something like an interactive nox.

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

2015-01-02 Thread Eelco Dolstra
Hi, On 02/01/15 12:57, Michael Jones wrote: If it helps at all, git seems to use GIT_PAGER first and then falls back to PAGER and then to `less` for the commands that use it. Perhaps nix could respect a NIX_PAGER env var? I've implemented this now, with the same semantics as GIT_PAGER and

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

2015-01-02 Thread Ertugrul Söylemez
Hi Eelco, There is a very good reason for this principle. If a program does more than what it's intended to do, then it hurts composability. There shouldn't be an issue with composability here, because Nix will only run the pager when stdout is a terminal. So things work fine if you pipe

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

2015-01-02 Thread Ertugrul Söylemez
Hi Eelco, If it helps at all, git seems to use GIT_PAGER first and then falls back to PAGER and then to `less` for the commands that use it. Perhaps nix could respect a NIX_PAGER env var? I've implemented this now, with the same semantics as GIT_PAGER and SYSTEMD_PAGER. Thanks a lot! What

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

2015-01-02 Thread Eelco Dolstra
Hi, On 02/01/15 14:49, Ertugrul Söylemez wrote: There is a very good reason for this principle. If a program does more than what it's intended to do, then it hurts composability. There shouldn't be an issue with composability here, because Nix will only run the pager when stdout is a

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

2015-01-01 Thread Charles Strahan
I agree with this. I have `less` configured to restore the screen at termination (via smcup/rmcup), which is a bit annoying if I want to keep the results around. I'd rather be explicit about opting-in to the pager being used (with `| less`) rather than opting-out (with `| cat`). I also have to

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

2015-01-01 Thread Ertugrul Söylemez
Hi everybody, since Nix 1.8 much of the output of nix commands is piped through `less`, which is certainly meant to be a convenience, but that convenience depends on a few assumptions: * the user uses a crappy terminal emulator, * the user is interested in all of the output, * the user