Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Search: no longer output to $PAGER #2656

Closed
wants to merge 1 commit into from
Closed

Conversation

evils
Copy link
Member

@evils evils commented Jan 26, 2019

Output search results to stdout, let the user see the results for install command.
As requested in #1261

@evils evils changed the title No longer output to $PAGER Search: no longer output to $PAGER Feb 10, 2019
Copy link
Member

@Ma27 Ma27 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I understand that several people are against my change and I'm perfectly fine with reverting this if there's a majority against this.

But please note that one of the reasons why I added this is that $PAGER-support was added to several commands (like nix-env or nix-store) already, so if you'd like to remove this, please drop all usages for consistency :)

@zimbatm
Copy link
Member

zimbatm commented Jan 6, 2020

Users who don't want a pager can export NIX_PAGER=cat but the reverse is not true.

@evils
Copy link
Member Author

evils commented Jan 7, 2020

I wasn't aware of the NIX_PAGER variable when i made this PR
nor do i recall ever seeing documentation for it.
If this variable can be supported while the default behaviour can be changed to cat, that would be preferable to me, but i'm not familiar enough with how these things are implemented to do that.
I think the current behaviour is less useful as one would usually want to type a nix-env -i command right after, and can't view the result while typing if less is used.
That was my use case when i was trying out nix on debian, and i think a bias in favour of usability for newcomers is not detrimental here. (an advanced user should know how to use NIX_PAGER, a beginner shouldn't)
As nix search seems like a natural first point of contact, i think it sends a bad message to potential users to break this convention.

@zimbatm
Copy link
Member

zimbatm commented Jan 7, 2020

looks like NIX_PAGER is only in the release notes and should be documented in the manual:

$ git grep NIX_PAGER
doc/manual/release-notes/rl-1.9.xml:  <listitem><para>The environment variable <envar>NIX_PAGER</envar>
src/libmain/shared.cc:    char * pager = getenv("NIX_PAGER");

@alexeymuranov
Copy link

IMHO, if NIX_PAGER is not set, there should be no paging.

@zimbatm
Copy link
Member

zimbatm commented Jul 3, 2020

The pager behaviour is consistent with other tools such as journalctl and git log

@evils
Copy link
Member Author

evils commented Jul 4, 2020

The pager behaviour is consistent with other tools such as journalctl and git log

i believe it is inconsistent with other package search tools such as apt and pkg

@edolstra
Copy link
Member

edolstra commented Jul 6, 2020

Inconsistent in what way?

@evils
Copy link
Member Author

evils commented Jul 6, 2020

Inconsistent in what way?

Other package managers don't use a pager to display their search results.
At least, the others i've used don't do so by default.

@stale
Copy link

stale bot commented Feb 12, 2021

I marked this as stale due to inactivity. → More info

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants