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

Add exit status codes to puter.exit(), and an exit builtin to Phoenix #421

Merged
merged 3 commits into from
May 30, 2024

Conversation

AtkinsSJ
Copy link
Collaborator

@AtkinsSJ AtkinsSJ commented May 23, 2024

puter.exit() now takes a status code, similar to the exit status on desktop OSes. This is passed to the appClosed event, so that eg a parent app can know whether its child app ran successfully.

I've limited the exit status to being a number. We could probably expand that later, but I feel slightly paranoid about someone using it for exploits somehow.

For now, Phoenix prints to stdout when a process exits with a non-zero status code. This is because we lack other ways of displaying or querying that status code.

This also lets us have an exit [CODE] shell builtin, finally. It's a little hacky but it works.

`puter.exit()` now takes a status code, similar to the exit status on
desktop OSes. This is passed to the appClosed event, so that eg a
parent app can know whether its child app ran successfully.
@AtkinsSJ AtkinsSJ marked this pull request as draft May 23, 2024 14:15
- Detect exit status of Puter apps, now that that's available.
- Store the exit status of each pipeline.
- Display a message when the exit status was non-zero.

That message is temporary, until we have a better way of displaying or
querying it, such as the `$?` shell variable.
@AtkinsSJ AtkinsSJ changed the title Add exit status codes to puter.exit() Add exit status codes to puter.exit(), and an exit builtin to Phoenix May 23, 2024
@AtkinsSJ AtkinsSJ marked this pull request as ready for review May 23, 2024 14:28
@AtkinsSJ AtkinsSJ mentioned this pull request May 24, 2024
@KernelDeimos KernelDeimos merged commit d57980c into HeyPuter:main May 30, 2024
6 checks passed
@AtkinsSJ AtkinsSJ deleted the exit-status branch May 31, 2024 08:07
Endercass pushed a commit to Endercass/puter that referenced this pull request Jul 6, 2024
Add exit status codes to `puter.exit()`, and an `exit` builtin to Phoenix
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.

None yet

2 participants