astrand / xclip

Command line interface to the X11 clipboard
GNU General Public License v2.0
1.04k stars 75 forks source link

xclip no longer exits when it loses the selection #64

Closed hackerb9 closed 3 years ago

hackerb9 commented 4 years ago

Hi!

xclip forks into the background and never exits. This was caused by a commit on July 17th (see below). You can test it like so:

echo "Testing whether xclip exits correctly when the selection is lost."
echo hello | ./xclip -verbose -i >/dev/null 2>&1 &
sleep 1
echo goodbye | ./xclip -i
sleep 1
if ps $! >/dev/null; then 
  echo "FAIL: Zombie xclip yet lives! Killing."
  pkill xclip
else
  echo "PASS: xclip exited correctly after losing selection."
fi

The first xclip process should exit when the second takes the selection, but it does not. I suggest that the above test should be put at the beginning of xctest (before it creates dozens of undying xclip processes).

6623ccd9e5c6c573c4a58b60fac80896e191344c is the first bad commit

In the commit before that, b161f2c5df3212ab18a2361e59d75d23a1efc676, xclip works correctly.

Thanks.

hackerb9 commented 3 years ago

Closing bug: has been fixed.