Cant copy a tab character from terminal

terminal

Solution

On macOS Sierra (maybe also in earlier versions), you can do:

Edit -> Copy Special -> Copy Plain Text

Or using the shortcut: alt+shift+⌘ cmd+C

Problem

I'm writing a small program that prints to the terminal its output in tab separated format. But whenever I select the text with tabs and copy it, the tabs are replaces with some number of spaces. What can I do to make terminal not replace tabs with spaces when trying to copy?

Original source