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

Return true instead of the new PID from %background #122

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jpco
Copy link
Collaborator

@jpco jpco commented Sep 23, 2024

I believe the fact that %background returns the PID of the process it creates is an oversight.

  • It only happens as a side-effect of assigning apid to the new PID.
  • The function has not changed since the "assignment returns the value" change went into effect.
  • Other shells (including, most relevantly, rc) return true from command &
  • It would be consistent with other cases where the "assignment returns the value" change had knock-on effects (see Does anybody here use `es -e`? #70).
  • It is entirely redundant to set $apid, print the new PID if interactive, and return the PID
  • In general there is a convention in es commands that they either produce output by returning it, or by printing it/performing side effects, and there is a pattern of defining functions (e.g., var) which echo the value returned from "inner" functions (e.g., %var)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant