Skip to content

Conversation

@AeroSageMage
Copy link

PR to enable the shutdown handling on MacOS following the same method from Windows machines ("nuclear options" that check for all the terminals.
udp_to_websocket.py was changed to trigger the correct script based on the platform. I got some help from Cursor to support with the compatibility between platforms and writing the PR.

- Create kill_aerofly_bridge.sh for macOS shutdown functionality
- Update Python script to detect platform and use appropriate shutdown script
- Support Windows (.bat), macOS (.sh), and Linux (.sh) shutdown scripts
- Maintain backward compatibility with existing Windows functionality
- Enable Exit Application button to work properly on macOS
- Add signal handlers for SIGINT and SIGTERM
- Implement graceful shutdown with SIGTERM before SIGKILL
- Fix read command compatibility (remove -p flag)
- Add proper cleanup function for interrupt signals
- Prevent 'address already in use' errors from ungraceful shutdowns
- Use subprocess.Popen() instead of subprocess.run() to avoid blocking
- Shutdown script now runs non-blocking to prevent deadlock
- Add 1-second delay before setting shutdown event as backup
- Prevents Python script from waiting for shutdown script that kills it
- Works on both Windows and macOS platforms
- Use pkill -9 (SIGKILL) instead of SIGTERM for immediate process termination
- Remove sleep delay from shutdown script for faster execution
- Remove waiting period from Python script - let shutdown script handle everything
- Ensure immediate shutdown without hanging or delays
- Kill terminal processes running start_aerofly_map.sh (equivalent to Windows cmd.exe kill)
- Target bash and zsh processes specifically
- Kill any remaining shell processes running Python servers
- Match Windows 'nuclear option' approach for complete shutdown
- Ensure all related processes and terminal windows are terminated
- Add nuclear option details for terminal process termination
- Include non-blocking execution information to prevent deadlock
- Update testing section with Exit Application button verification
- Add force termination and complete cleanup benefits
- Update file change counts to reflect final implementation
- Include notes about matching Windows approach for complete shutdown
- PR_EMOJI_COMPATIBILITY.md: Pull request template for emoji fixes
- PR_MACOS_LAUNCHER.md: Pull request template for macOS launcher
- PULL_REQUEST_SUMMARY.md: Overview of all pull requests created
- README_macOS.md: macOS-specific setup and troubleshooting guide
- check_dependencies.py: Utility script to verify Python dependencies

These files provide comprehensive documentation and tools for the macOS compatibility improvements.
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.

1 participant