Skip to content

Cancel idle commands without racing process startup - #94

Merged
Gubarz merged 1 commit into
cheatmd-dev:mainfrom
echo8134:fix/idle-timeout
Oct 13, 2026
Merged

Gubarz merged 1 commit into
cheatmd-dev:mainfrom
echo8134:fix/idle-timeout

Conversation

@echo8134

Copy link
Copy Markdown
Contributor

Summary

The idle timer read cmd.Process while process startup wrote it. Use CommandContext and context cancellation so the timer does not access process state. Preserve the existing inactivity timeout and output resets.

Related issues

No linked issue.

Verification

Silent and output-producing command tests pass under the race detector. Built before/after binaries were exercised through the full five-minute timeout; the startup race disappears.

Local checks passed on Go 1.27.1. The CI workflow uses Go 1.26.3.

Checklist

  • go build ./... and go test ./... pass
  • gofmt -l . and go vet ./... are clean
  • Added regression tests for the changed behavior
  • cheatmd --lint examples/ passes
  • Docs/wiki changes are not needed for this fix

@Gubarz
Gubarz marked this pull request as ready for review October 13, 2026 04:18
@Gubarz
Gubarz merged commit dbeb3b0 into cheatmd-dev:main Oct 13, 2026
1 check passed
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.

2 participants