asweigart / pyperclip

Python module for cross-platform clipboard functions.
https://pypi.python.org/pypi/pyperclip
BSD 3-Clause "New" or "Revised" License
1.6k stars 193 forks source link

copy_xclip hangs the terminal when you try to exit #247

Open ngn13 opened 1 year ago

ngn13 commented 1 year ago
user@host~# python3
>>> import pyperclip
>>> pyperclip.copy("test")
>>> exit()
user@host~# exit
(terminal hangs)

xclip -selection c still runs in the background after copy_xclip() function, which prevents the terminal from exiting. I think adding something like

subprocess.call(["killall", "xclip"], stdout=subprocess.PIPE, stderr=subprocess.PIPE)

would solve the problem.