Skip to content

Status exit code - #497

Open
dlech wants to merge 1 commit into
pybricks:masterfrom
dlech:status-exit-code
Open

Status exit code#497
dlech wants to merge 1 commit into
pybricks:masterfrom
dlech:status-exit-code

Conversation

@dlech

@dlech dlech commented Sep 7, 2026

Copy link
Copy Markdown
Member

This depends on #496 so includes those patches for now. The actual feature is just the last patch.

MicroPython v1.29 has a feature to allow getting the exit code from the runtime in embedded ports now. We can use this feature to pass that exit code to remote tools in order to provide users more helpful information on why their program ended.

I put it in the existing status event type since that already contains a flag that says if the user program is running or not. So this avoids any race conditions in getting this information out.

@dlech
dlech requested a review from laurensvalk September 7, 2026 17:15
The status report event now also carries the exit code of the program that
ran most recently. It is recorded just before clearing the user program
running flag so that hosts always receive both in the same update. Stopping
a program gives it a distinct exit code so that it can be told apart from a
program that ran to completion.
@dlech
dlech marked this pull request as ready for review September 12, 2026 15:01
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