Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Popen to prevent signal passthrough #265

Open
shiribailem opened this issue Jun 21, 2024 · 0 comments
Open

Fix Popen to prevent signal passthrough #265

shiribailem opened this issue Jun 21, 2024 · 0 comments

Comments

@shiribailem
Copy link

Context: I'm using GKT4 so I have to use the xclip or xsel clipboards, my app monitors the clipboard and crashes anytime I try to use CTRL+C to copy text.

The reason and fix are straightforward, subprocess.Popen is passing through keyboard signals, so CTRL+C is killing the clipboard application being called.

The fix is outlined here: https://stackoverflow.com/questions/5045771/python-how-to-prevent-subprocesses-from-receiving-ctrl-c-control-c-sigint

Gist is to basically just add an intercept of the signals into Popen calls, which will keep the CTRL+C from being passed through.

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

No branches or pull requests

1 participant