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

Allow executing another command once a background/non-blocking command terminates #83

Open
fritzrehde opened this issue Nov 28, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@fritzrehde
Copy link
Owner

I think this would be quite useful for more powerful scripting.
The updated exec & command could maybe look like:

exec & -- <CMD> ---- <OP>

This design would entail: CMD is executed non-blockingly, and once it terminates, <OP> is added to the remaining_operations. The question would be: if, at that point, the remaining_operations are not empty, then we have to decided where exactly to add OP. Should it be executed directly (before all other operations), or only after all queued operations? I would argue it should be appended to the list, because we usually only have a non-empty remaining_operations when we are currently in a blocking state, where nothing should be allowed to be executed. Therefore, OP would only be executed once we have an empty remaining_operations.
We would still have to decide on how to separate exec & -- <CMD> from <OP>. Not sure if ---- is ideal there, I think we shouldn't use a simple -- though, as that would be confusing if we e.g. have exec & -- <CMD> -- exec & -- <CMD>". Maybe we should remove --fromexec & -- ` entirely, but I really like that syntax for creating separation.

@fritzrehde fritzrehde added the enhancement New feature or request label Nov 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant