Write full screen output/buffer to a file

If you are inside a screen, and need to write the entire contents to a file (not just the ones currently visible), this will work:

<C-a> :hardcopy -h <filename>.