mirror of
https://github.com/asciinema/asciinema.git
synced 2026-04-25 07:55:51 +03:00
[GH-ISSUE #599] return value #928
Labels
No labels
bug
compatibility
feature request
fit for beginners
help wanted
hosting
idea
improvement
packaging
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/asciinema#928
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @charliez0 on GitHub (Dec 27, 2023).
Original GitHub issue: https://github.com/asciinema/asciinema/issues/599
Describe the bug
A clear and concise description of what the bug is.
When the program triggered by asciinema exit with non-zero value, asciinema returns zero
To Reproduce
Expected behavior
return non-zero when triggered program exit code non-zero
Versions:
Additional context
Add any other context about the problem here.
@ku1ik commented on GitHub (Jan 8, 2024):
Given asciinema itself finished without errors, finished recording successfully, I think the current behaviour is not too bad. But it really depends on what one expects here.
What do you think of an option, e.g.
--returnor similar, to exit with the code returned by the recorded program?scriptcommand (which asciinema was inspired by) does it via-e / --returnfor example.@charliez0 commented on GitHub (Jan 16, 2024):
Yes, it would be great to add one option so that no breaking changes would made to fix this
@moritzdietz commented on GitHub (Jan 18, 2024):
I know that some cli tools have an option to "transfer" exit codes depending on what happens inside of the application.
jqfor example has the option--exit-statushttps://jqlang.github.io/jq/manual/
Another example is curl with their
--failargument:I can see the appeal for CI stuff maybe?!
@ku1ik commented on GitHub (Jan 18, 2024):
Many good ideas there, thanks.
I see 2 options:
a) forward exit code from the recorded shell/command as is (like script does),
b) use specific exit codes for different failure scenarios (like jq)
I'm leaning towards a) but I'm open to all ideas.
@moritzdietz commented on GitHub (Jan 18, 2024):
I really like option a.) as well!
@balupton commented on GitHub (Jan 24, 2025):
The standardised term for them is exit status:
As for this feature request, what specifically is the use case that warrants it? I had thought about exit statuses myself for my own use case.
As for the implementation of exit status, there seems to various rolls exit status can play in asciinema.
asciinema recreturn the exit status it encountered while returning, what the OP in this thread seems to be aboutasciinema playreturn the exit status it recorded in the cast files, optionalFor me, the first request here, the recording of exit statuses is the important part, and it seems that is not currently done:
Having exit statuses being recorded will allow me to use asciinema and its cast files to automatically test and verify experiences remain consistent across my own CLI iterations, while at the same time having recording of expected experiences for publicity and documentation.
If the second or third request in implemented, then I would expect asciinema to return an appropriate exit status for when an error occurs within asciinema's recording or playback of the cast file, perhaps
132would be a contender:Taken from https://github.com/bevry/dorothy/blob/master/docs/bash/errors.md which documents various standardised exit statuses.
@ku1ik commented on GitHub (May 31, 2025):
2 things just landed in
develop:--returnoption forrec,streamandsessioncommands - propagates session exit status