For a while now, I’ve been using urxvt as my terminal of choice in Linux – it’s small, light and fast, as all terminals should be, but still has some decent features. However, I won’t take that discussion any further – the rest of the internet should provide you with plenty of reading material on the topic of terminal choice.
The issue I’ve been having is that I sometimes got a page out of my printer consisting of the contents of the terminal window. urxvt (and its non-Unicode sibling rxvt) have a sometimes-handy feature that pressing Print Screen will print such a page. However, it also seems that there’s another key combination that does the same thing, since I’m not aware of pressing Print Screen but have still been wasting paper and ink on useless printouts. For the sake of my pocket (and the trees – won’t someone please think of the trees!), I decided that this state of affairs could not continue, so I figured out how to disable printing altogether.
It turns out that (u)rxvt has an option to specify what command it runs when it’s asked to print something, so it’s a trivial matter to make it send its output to the black hole that is /dev/null. Simply add one of the following lines to your ~/.Xdefaults file (depending on which terminal you’re using):
rxvt.print-pipe: "cat > /dev/null" urxvt.print-pipe: "cat > /dev/null"
Restart your terminal, and you’ll never see it printing things again.
Of course, if you can think of a reason why you might want to print the terminal contents, you can always set the destination of the cat command to a file somewhere, so you can grab its contents if you need them. As always, the choice is yours.