Conversation
…nvironments - Modified restart_app() in window.py to use QApplication.exit(EXIT_CODE_RESTART) - Updated restart_application() in main.py to handle Windows and Linux properly - Removed unused subprocess import from window.py - The restart now properly uses the EXIT_CODE_RESTART mechanism Co-authored-by: WSXYT <102407247+WSXYT@users.noreply.github.com>
Co-authored-by: WSXYT <102407247+WSXYT@users.noreply.github.com>
…tart exit - Moved subprocess and platform imports to module level - Simplified executable assignment (removed redundant condition) - Added os._exit(0) after successful Windows restart to properly terminate current process Co-authored-by: WSXYT <102407247+WSXYT@users.noreply.github.com>
- Moved EXIT_CODE_RESTART import to module level in window.py - Simplified exception handling in restart_application - Updated comments to clarify macOS support in restart logic Co-authored-by: WSXYT <102407247+WSXYT@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix restart functionality to ensure proper execution
Fix restart functionality: use exit code mechanism instead of direct process spawning
Jan 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Restart functionality failed because
restart_app()attempted to spawn new processes directly with Windows-specific subprocess code and calledsys.exit(0), bypassing the existingEXIT_CODE_RESTARTmechanism. This broke packaged builds and non-Windows platforms.Changes
app/view/main/window.py
QApplication.exit(EXIT_CODE_RESTART)main.py
restart_application()with platform-specific logic:subprocess.Popen()withDETACHED_PROCESSflagsos.execl()to replace current processKey change
The restart now flows through the proper cleanup and exit handler that checks for
EXIT_CODE_RESTART, ensuring resources are released correctly before relaunching.Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.