Auto-exit in --headless --exec mode when script completes #127
Labels
No Label
Alpha Release Requirement
Bugfix
Demo Target
Documentation
Major Feature
Minor Feature
priority:tier1-active
priority:tier2-foundation
priority:tier3-future
Refactoring & Cleanup
system:animation
system:documentation
system:grid
system:input
system:performance
system:python-binding
system:rendering
system:ui-hierarchy
Tiny Feature
workflow:blocked
workflow:needs-benchmark
workflow:needs-documentation
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: john/McRogueFace#127
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
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?
Problem
Currently,
./mcrogueface --headless --exec <script>hangs indefinitely after the script completes. The game loop continues running because there's no mechanism to detect script completion and exit automatically.This requires workarounds like:
timeoutcommands to kill hung processesmcrfpy.exit()calls in every scriptRoot Cause
File:
src/main.cpp:197-203When
--execis used, the code callsengine->run()which starts an infinite loop (while (running)inGameEngine.cpp:197). Therunningflag never becomesfalseunless:mcrfpy.exit()Proposed Solution
Auto-exit when no more Python work is pending in headless + exec mode:
auto_exit_after_execflag toMcRogueFaceConfig--headlessand--execare presenttimers.empty()andauto_exit_after_execis trueImplementation Details
Files to modify:
src/McRogueFaceConfig.h- Add flagsrc/main.cpp:197-203- Set flag appropriatelysrc/GameEngine.cpp:191-291- Check condition in game loopExit condition:
Benefits
timeoutwrappersmcrfpy.exit()continue working)Edge Cases Handled
mcrfpy.exit()exit immediately (auto-exit never triggers)Success Criteria