Add a context menu to the output window with Copy and Select all buttons.

Fixes issue #3265.