astrand / xclip

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

-clear option #5

Open astrand opened 14 years ago

astrand commented 14 years ago

clears the contents of all clipboards.

Reported by: benkibbey

Original Ticket: xclip/patches/3

astrand commented 14 years ago

clear the contents

Original comment by: benkibbey

astrand commented 14 years ago

Won't xclip </dev/null do the job here?

Original comment by: dallaylaen

astrand commented 14 years ago

Sorry, I haven't read "all clipboards".

Original comment by: dallaylaen

hackerb9 commented 3 years ago

All clipboards? Interesting idea. How often do people want to do that?

Is it good enough to set the selection to the empty string? Is it better to clear the selection by replacing the owner? What about first sending a "delete" request to the selection owner?

I think it makes sense to be able to forcibly remove the owner of a specific selection (instead of just setting the selection to the empty string). How about having syntax that's something like this:

xclip -clear PRIMARY          # Clears only PRIMARY selection
xclip -clear all                    # Clears PRIMARY, SECONDARY, & CLIPBOARD

Also, are we also talking about clearing the old style X cut-buffers? That could be handy if the X server actually frees the space they used up. (Some old docs say the X server doesn't release the memory until restart, but perhaps that's no longer true.)