XClearBuffer

XTerm on Solaris 2.3 had a convenient feature where you could select null text to copy to the X cut buffer. I frequently used this feature to protect against a long-standing complex motor tic involving my right middle finger which tends cause me to paste copied text into my xterms.

The null text trick dosen't work with any other xterms I've encountered (with the possible exception of Ultrix), so I wrote xclearbuffer as a quick hack to replace this accidental feature. I usually have one of the buttons in my window titlebars set to launch xclearbuffer.

Some time later, I replaced xclearbuffer with a three-line shell script which does the same thing better:

#!/bin/dash
/usr/bin/xsel --clear --primary > /dev/null
/usr/bin/xcb -s 0-7 < /dev/null > /dev/null

Obsolete source code