Skip to content

Keep Windows terminal open on error by default#6667

Merged
rom1v merged 1 commit intodevfrom
pause-if-error-windows
Feb 21, 2026
Merged

Keep Windows terminal open on error by default#6667
rom1v merged 1 commit intodevfrom
pause-if-error-windows

Conversation

@rom1v
Copy link
Collaborator

@rom1v rom1v commented Feb 10, 2026

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.exe implicitly sets --pause-on-exit=if-error
  • running from a terminal or a .bat does 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).

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.

PR #6667 <#6667>
@rom1v rom1v force-pushed the pause-if-error-windows branch from 93835f5 to 8b0206f Compare February 21, 2026 11:18
@rom1v rom1v merged commit 8b0206f into dev Feb 21, 2026
rom1v added a commit that referenced this pull request Feb 24, 2026
Refs #6667 comment <#6667 (review)>

Suggested-by: anotheruserofgithub
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