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
environment.nix: Split "less -R" into PAGER and LESS #110960
base: master
Are you sure you want to change the base?
Conversation
Setting `PAGER="less -R"` relies on word splitting to work out properly. Less also reads options from from a variable named `LESS`, by setting `PAGER="less"` and `LESS="-R"` we don't have to rely on word splitting.
Thinking about the constellation of possible settings:
In any case, I think this is probably low impact beyond mild annoyance. |
While I don't have a particularly strong opinion on this, my understanding is that sudoedit(1)'s handling of
From man(1):
|
To be clear, I'm not against this change (although I'll have to override |
Looks like this has already been fixed for |
I was told in the #bash channel that relying on word-splitting causes no end of trouble. Hence the solution here. Note that I did at first intend to simply fix nb but was discouraged by the people who frequent that channel (I assumed they know what they're talking about). Doesn't |
I marked this as stale due to inactivity. → More info |
Setting
PAGER="less -R"
relies on word splitting to work out properly.Less also reads options from from a variable named
LESS
, by settingPAGER="less"
andLESS="-R"
we don't have to rely on word splitting.Motivation for this change
The
PAGER="less -R"
setting has always worked fine for me until today. I was trying out a bash script for note-taking and it errored with "command not found: less -R". By setting the option inLESS="-R"
instead we can avoid relying on word splitting. I believe this should only make it work in more cases not less.One backwards incompatibility issue is that people who don't like the
-R
flag and have overriddenPAGER
withless
would have to clear the setting forLESS
.Things done
sandbox
innix.conf
on non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
./result/bin/
)nix path-info -S
before and after)