Keep Windows terminal open on error by default by rom1v · Pull Request #6667 · Genymobile/scrcpy (original) (raw)
If scrcpy is launched by double-clicking scrcpy.exe in Windows Explorer, automatically set --pause-on-exit=if-error.
Without this, the terminal would close immediately, preventing the user from seeing the error.
Also remove scrcpy-console.bat, which is now useless.
Detecting whether it is launched by double-clicking relies on a heuristic (it is not 100% reliable). Basically it checks how many processes share the console. If there is only one, then it's probably launched by double-clicking from Windows Explorer. In practice, it works:
- running by double-clicking on
scrcpy.exeimplicitly sets--pause-on-exit=if-error - running from a terminal or a
.batdoes not implicit pause on exit.
Like #6662, the goal is to avoid getting a window that disappears without knowing why, which could suggest that a crash occurred (even though there is no crash).