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

vared: avoid using local variables #8837

Merged
merged 1 commit into from
Mar 27, 2022
Merged

Conversation

zanchey
Copy link
Member

@zanchey zanchey commented Mar 27, 2022

The tmp and prompt variables collide with variables used as arguments.
Just avoid them entirely, at the cost of making the internals of the
functions somewhat more complicated.

Fixes issue #8836.

TODOs:

  • Changes to fish usage are reflected in user documentation/manpages.
  • Tests have been added for regressions fixed
  • User-visible changes noted in CHANGELOG.rst

@zanchey zanchey added this to the fish 3.5.0 milestone Mar 27, 2022
@zanchey zanchey linked an issue Mar 27, 2022 that may be closed by this pull request
read -p 'set_color green; echo '$argv'; set_color normal; echo "> "' \
(if not set -q $argv; echo -g; end) \
-c "$$argv" \
$argv
Copy link
Contributor

Choose a reason for hiding this comment

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

LGTM. Any other complete solution would be more complicated.

The tmp and prompt variables collide with variables used as arguments.
Just avoid them entirely, at the cost of making the internals of the
functions somewhat more complicated.

Closes fish-shell#8836.
@zanchey zanchey merged commit fa2450d into fish-shell:master Mar 27, 2022
@zanchey zanchey self-assigned this Mar 27, 2022
@zanchey zanchey deleted the vared-locals branch March 27, 2022 15:53
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 27, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

vared tmp doesn't set tmp
2 participants