I am running a java script, which has some text output. I'd like to copy/paste that output. If I do ⌘-A, it copies everything that's been typed that session, even if I typed
clear beforehand. How can I copy only what is currently displayed?
- Use pbcopy:
echo 'sup3ru53r' | pbcopy
- Select the text and copy (⌘ cmd+C)
Without modifying your code, you can...:
- Set the number of buffered lines equal to your screen size, in Terminal Preferences. It can be found under the Settings tab, and then the Windows button.
- Clear the scrollback buffer with cmd-K immediately before running your script, then use cmd-A C as normal.