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

export VAR=value exit status is 1 (but set -x exits cleanly) #4435

Closed
spinningarrow opened this issue Sep 29, 2017 · 2 comments
Closed

export VAR=value exit status is 1 (but set -x exits cleanly) #4435

spinningarrow opened this issue Sep 29, 2017 · 2 comments
Labels
bug Something that's not working as intended
Milestone

Comments

@spinningarrow
Copy link

spinningarrow commented Sep 29, 2017

fish --version: fish, version 2.6.0
uname -a: 16.7.0 Darwin Kernel Version 16.7.0: Thu Jun 15 17:36:27 PDT 2017; root:xnu-3789.70.16~2/RELEASE_X86_64 x86_64
$TERM: screen-256color

I understand that the idiomatic way to export variables in fish is using set -x. However, export is also available for compatibility. When I use export, the variable gets set and exported, but the exit code of the export function is 1. Is this normal?

@floam floam added the bug Something that's not working as intended label Oct 1, 2017
@floam
Copy link
Member

floam commented Oct 1, 2017

This is because set retains the status of the previous command if all goes well (#3651). In export.fish, we're stuck returning 1 when we hit the else clause after the contains test fails. We can work around this in export.fish by resetting the status.

@floam floam closed this as completed in 1ef310c Oct 1, 2017
@floam
Copy link
Member

floam commented Oct 1, 2017

Fixed, thanks!

@zanchey zanchey added this to the fish 2.7.0 milestone Oct 1, 2017
zanchey pushed a commit that referenced this issue Oct 1, 2017
Fixes #4435

(cherry picked from commit 1ef310c)
@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.
Labels
bug Something that's not working as intended
Projects
None yet
Development

No branches or pull requests

3 participants