Skip to content

vared: avoid using local variables#8837

Merged
zanchey merged 1 commit into
fish-shell:masterfrom
zanchey:vared-locals
Mar 27, 2022
Merged

vared: avoid using local variables#8837
zanchey merged 1 commit into
fish-shell:masterfrom
zanchey:vared-locals

Conversation

@zanchey
Copy link
Copy Markdown
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
Copy Markdown
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