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

Disable scope shadowing for fish's wrapper functions? #5175

Closed
InspectorMustache opened this issue Sep 7, 2018 · 1 comment
Closed

Disable scope shadowing for fish's wrapper functions? #5175

InspectorMustache opened this issue Sep 7, 2018 · 1 comment

Comments

@InspectorMustache
Copy link

This doesn't work:

set -lx MANPAGER more
man ls

But this does:

set -lx MANPAGER more
command man ls

So I was wondering if it might be a good idea to disable scope shadowing for fish's wrappers for standard command line utilities like man, grep, ls etc.

@faho
Copy link
Member

faho commented Sep 7, 2018

This is a duplicate of #1091.

The problem is that exported variables aren't "exported" to functions. When they are global (or universal), that doesn't matter, but with "-lx", this happens. #4149 copies the variables by creating new locals with the value.

So it doesn't matter anymore whether your man is a function or not, it'll have $MANPAGER defined.

@faho faho closed this as completed Sep 7, 2018
@faho faho added the duplicate label Sep 7, 2018
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 17, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants