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 ExitCode to the "Exited" message #174

Merged
merged 6 commits into from
Mar 13, 2024

Conversation

prog-supdex
Copy link
Collaborator

Resolve #169

Add the Exit code to the "Exited"

start/process.go Outdated
@@ -209,3 +210,14 @@ func (p *process) respawn() {
p.waitPid()
p.output.WriteBoldLinef(p, "Restarted with pid %v...", p.pid)
}

func (p *process) reportExitCode() {
exitCode := p.tmux.ExitCode()
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tmuxClient.ExitCode() returns the maximum exit code among all panes. It's not applicable here

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks, done!

start/process.go Outdated
Comment on lines 216 to 220
message := "Exited"

if exitCode != 0 {
message = fmt.Sprintf("Exited with code %d", exitCode)
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it hurt to always print exit code?

Suggested change
message := "Exited"
if exitCode != 0 {
message = fmt.Sprintf("Exited with code %d", exitCode)
}
message := fmt.Sprintf("Exited with code %d", exitCode)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done!

@DarthSim DarthSim merged commit 31fc1c9 into DarthSim:master Mar 13, 2024
5 checks passed
@jcburley
Copy link

Thanks!!

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.

Write Nonzero Exit Code After "Exited"?
4 participants