Disable printing in rxvt and urxvt

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.


  1. No problem. Do you happen to know what key combination was triggering the print? I’d like to know, because disabling the key combo would be better than disabling the whole print mechanism.

  2. Thanks for this. I was on a network where the default printer was some random thing in a different part of the building, so I didn’t even notice this for months…

  3. FTM, restarting (u)rxvt only pulls the new X resources after an ‘xrdb -merge ~/.Xdefaults’.


  4. Thank you, I’ve been sporadically printing terminal pages for years! (On a common printer in the office’s printing room. Embarassing when your colleagues go through your console stuff with all typos, regexes and so on).

Leave a Reply

Your email address will not be published. Required fields are marked *