One day around 7 or 8 years ago, when I arrived at the office, I saw something strange at my desk. In the middle of it laid a rather thick printout: 30 or 50 double-sided pages, filled with C++ code, compiler errors and obscure Unix commands. Cherry on the top were comments on the errors – all handwritten with a red pen and suggesting how to fix and improve the code.

It was the printout of my terminal session! I could tell, because there was a shell prompt with my user name everywhere. I also recognized my code which wasn’t checked in the central repository yet. Obviously, it was a prank of one of my coworkers. But how did they access my terminal session? Was there a security breach? Did I forget to lock the computer the day before?

At that time I was using urxvt for virtual terminal. One of its features, enabled by default, is that when you press a PrintScreen key, it sends the visible part of terminal to lpr. Using Ctrl+PrintScreen or Shift+PrintScreen does the same, but it includes whole scroll back.

In graphical environments, I have always used PrintScreen to capture a screen (and you probably see where this is going). The day before I had tried to take a screen shot of terminal window, while also pressing Ctrl or Shift – either by accident, or because I forgot the exact key combination to capture a single window. The terminal, a good servant, obeyed and sent the whole scroll back, 10000 lines, to the printer, no questions asked. I haven’t noticed, because it was a network printer on the other side of the building.

It was the most seamless printing experience in my life. Never before and never after lpr had worked for me that flawlessly at the first try! Printing on Linux has really gone a long way since the 90s!

After that, I had disabled PrintScreen key in urxvt and soon after I switched to st. It didn’t have the printing feature built-in, but it had true colors support which greatly improved my Vim experience.