Copy paste problem - works every other time

I had the same problem and thank you this worked, it was driving me crazy on vsc, same build tho (arch, kde)

How do I solve this problem?

closed due to frequent necro bump