Skip to content

Add ExitCode to the "Exited" message - #174

Merged
DarthSim merged 6 commits into
DarthSim:masterfrom
prog-supdex:exited_with_code
Mar 13, 2024
Merged

DarthSim merged 6 commits into
DarthSim:masterfrom
prog-supdex:exited_with_code

Conversation

@prog-supdex

Copy link
Copy Markdown
Collaborator

Resolve #169

Add the Exit code to the "Exited"

Comment thread start/process.go Outdated
}

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

Copy link
Copy Markdown
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
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

thanks, done!

Comment thread 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
Copy Markdown
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
Copy Markdown
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
@jcburley

Copy link
Copy Markdown

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