terminal cut and paste
When cut and pasting from terminal into another text document, the terminal formating / colors, also get copied and pasted. I just wantt the text. This was not an issue in Mountain Lion.
Anyone know how to fix?
When cut and pasting from terminal into another text document, the terminal formating / colors, also get copied and pasted. I just wantt the text. This was not an issue in Mountain Lion.
Anyone know how to fix?
You can disable copy/pasting the formatting from Terminal by changing the com.apple.Terminal preferences file.
Open Terminal on your Mac and enter the following command:
defaults write com.apple.Terminal CopyAttributesProfile com.apple.Terminal.no-attributes
This will strip all text attributes out of copy/pasting from Terminal
I'm having the exact same issue. I do a lot of work in the terminal by ssh'ing into network devices and need to copy text from terminal and paste into other apps but since Mavericks, it is copying the color also.
Apple, please provide a fix for this. Why would anyone ever want to copy the background color of Terminal app (rhetorical).
Hey Tony.
Thanks - yep, that works. If you find a way to set the behavior back to the way it use to be in ML, let us know. I'm not lazy or spoiled :-), but it would be nice just just do cmd+c, cmd+v but your solution will save me lots of time as I was pasting into textedit to drop the color then re-copying.
Again, thanks!
Tony's solution is just the keyboard short-cut for Paste and Match Style from the Edit menu in TextEdit. To always paste monochrome with command+V, you need to change document type from RTF to plain text in TextEdit preferences. Exit and restart TextEdit for these changes to take effect.
Using just cmd+c, cmd+v sequence, I copied color content from Terminal and pasted into TextEdit as monochrome. Tested on Mavericks.
When you use copy, you may potentially copy multiple different representations of the same data. If the place where you paste can understand the version with the colors, it will accept that. If you want just text, you will have to use Paste and match style or use some utility that will sttrip the styles from your clipboard.
I understand that ⇧⌥⌘V is simply the "Match Style" version of Paste but I was not looking under Edit menu as I knew that ⌘C and ⌘V was what I wanted - or thought I wanted.
@etresoft, yeah, I agree the ⌘C copies as much context as possible (including color) and if it is pasted into an app that understands it, then it is used; however, that should be the case for practically all applications but Terminal should NOT be one of them. We should simply be able to copy and past text out of the terminal as we have always done. Better yet, we really need to be able to configure Terminal->Prefs the option to ⌘C (copy) only text out of Terminal or text and color. Maybe there is a hidden defaults command that can be set.
Why not? If you hae configured Terminal to display colour, why shouldn't that get copied into the clipboard too? If Terminal didn't have this new ability then how do we know there wouldn't be someone else posting a complaint about why Terminal can display colours but can't copy them to the clipboard. Why would that complatin be less valid than your complaint now? It seems that now we have the best of both worlds. If you want colour, it is availble. If you don't, then don't use it.
Because Terminal is a text-based application. If we took your approach then why would XCode let me copy text from that text window without grabbing the color? Or why would text-edit let me do it. The fact is, for text-based applications, people may want to alter the background of the application itself to offer higher contrast between the text and background for easier viewing or for text selection to appear easier but that doesn't mean we want to copy the background. I think that a more logical appoach would be to let those who want to copy the background color to set that through Terminal->Preferences.
We'll just have to disagree on this one. Maybe I can set the background of my Terminal Window to a JPEG image of a solid color and it might let me simply copy the text. This ⇧⌥⌘V is a lot of keys to match for someone who is use to a very quick C and V. I now have to look at the keyboard to accomplish a task I could previously do blind.
Actually, it is two extra keys.
I normally ⌘C, hold the ⌘ down, move the mouse over to the email to the customer I'm trying to help, and hit the V. Now it is ⌘C, move the mouse over to the email to the customer, then ⇧⌥⌘V (shift with pinky, Alt with ring finger, command with middle finger, then get the pointer over to V.
Nah, too hard, let me just copy the text from the Terminal on my right-27" screen, then move the mouse over to the mail app over on the left 27" screen, now keep moving the mouse on over and up to the left to the Mail -> Edit -> Paste and Match Style and my head is now pointing all 70 degrees left.
No I do this many times 8 hours a day and I have it is just a pain. Not going to hapen. I love Terminal and the way I can split-screen but other colleagues use iTerm and I've never gone that route -- maybe, regretfully, it is time to consider.
TarheelTechie wrote:
... then ⇧⌥⌘V (shift with pinky, Alt with ring finger, command with middle finger, then get the pointer over to V.
Nah, too hard,
I must have a big thumb, as I can always hit the ⌥⌘ combo with one thumb.
Don't use color in Terminal 🙂
Seriously, just re-map ⇧⌥⌘V to another key combo.
TarheelTechie wrote:
why would XCode let me copy text from that text window without grabbing the color? Or why would text-edit let me do it.
What are you talking about? Xcode has copied rich text for a long time. I used to easily test rich text on the pasteboard by copying code with syntax highlighting from Xcode into my program.
I really don't understand the comment about "text-edit". It has supported rich text since day one.
R-MacBook-Pro:~ $ ipcalc 233.200.79.160/27
Address: 233.200.79.160 11101001.11001000.01001111.101 00000
Netmask: 255.255.255.224 = 27 11111111.11111111.11111111.111 00000
Wildcard: 0.0.0.31 00000000.00000000.00000000.000 11111
=>
Network: 233.200.79.160/27 11101001.11001000.01001111.101 00000
HostMin: 233.200.79.161 11101001.11001000.01001111.101 00001
HostMax: 233.200.79.190 11101001.11001000.01001111.101 11110
Broadcast: 233.200.79.191 11101001.11001000.01001111.101 11111
Hosts/Net: 30 Class D, Multicast
R-MacBook-Pro:~ $ ipcalc 233.200.79.160/27
Address: 233.200.79.160 11101001.11001000.01001111.101 00000
Netmask: 255.255.255.224 = 27 11111111.11111111.11111111.111 00000
Wildcard: 0.0.0.31 00000000.00000000.00000000.000 11111
=>
Network: 233.200.79.160/27 11101001.11001000.01001111.101 00000
HostMin: 233.200.79.161 11101001.11001000.01001111.101 00001
HostMax: 233.200.79.190 11101001.11001000.01001111.101 11110
Broadcast: 233.200.79.191 11101001.11001000.01001111.101 11111
Hosts/Net: 30 Class D, Multicast
Hi Tony,
I want to copy the terminal output with the colors and format but failed using command +c and command +v,I don't like the plain text, is there any special setting in the terminal ?
Thanks,
Fangfeiyiye
Hi Apple users
I just switched from using a ML and a Windows system to Maverick only. The new terminal cut and paste behaviour is odd: A terminal is a text-only application. (at least, it used to be in the last 20 years that I used terminals) I'd like to see an option that I can switch back to the text-only cut&paste behaviour.
I DO NOT want to use any other cut/paste key. One of the reasons for me to use OSX is consistent cut/paste behaviour (as opposed to using a (putty) terminal in Windows, or even a virtual Linux machine on Windows, where Ctrl-C is copy in Windows, but will kill an application in a terminal).
Using CMD-C/CMD-V in ML solved this issue, Maverick unsolved it!
I hear ya barkin but unfortunately I have had to suck it up and start using Shift-Alt-Cmd-V when copying from Terminal to Mail or whatever other app. It was either that or Cmd-C and copy to TextEdit and Copy back off it and Paste and that was even more horrendous.
Its terrible but the brain does get used to the new key command... eventually.
terminal cut and paste