How can I copy on select in the OS X Terminal like PuTTY does?
Solution 1
Install SIMBL and then install TerminalCopyOnSelect.
- At first, you should install SIMBL.
- Download the zipped plugin file I mentioned above and expand it.
- Copy the extracted file "TerminalCopyOnSelect.bundle" to the plugin directory which is located at ~/Library/Application Support/SIMBL/Plugins/
- Terminate all processes of Terminal.app and restart it.
Solution 2
In Terminal, select something and then within the same Terminal window do one of the following:
-
click and drag the selection (a bit; the mouse pointer will change), and release to paste (hit Esc while dragging to cancel)
or: paste using Shift-Command-V
or: paste using the middle mouse button
Solution 3
iTerm, an alternative to Terminal, can do this.
Solution 4
iTerm 2 also has an option to copy text to the normal clipboard on selection:
You can remap the middle button to paste from the clipboard:
Like in Terminal, you can also use shift-command-V (Edit > Paste Special > Paste Selection) to paste the text that is selected elsewhere in the current window.
Solution 5
To answer your 4 questions:
That putty option to select and then right-click to paste in the best invention after the mouse. Is there anyway to make the terminal do this?
No, you can however select the text you want and drag-n-drop your selection to the command prompt.
Hack the source code?
Probably can be done through reverse engineering, but why bother for something so trivial, and the fact that it's illegal :P
Install something?
iTerm as kbisset suggests.
Are the source code for the mac terminal public available?
No but iTerm's is
Related videos on Youtube
Shiju Shaji
Updated on September 17, 2022Comments
-
Shiju Shaji over 1 year
That PuTTY option to select and then right-click to paste is the best invention after the mouse. Is there any way to make Terminal in OS X do this? Hack the source code? Install something?
Is the source code for the OS X Terminal publicly available?
-
Noumenon over 3 yearsI suggest changing the accepted answer to the one with 4x the upvotes that doesn't require an install.
-
Timo about 2 years'..best invention after mouse', plus one.
-
-
Josh over 14 yearsI use Cmd-Shift-V all the time!
-
Shiju Shaji over 14 yearsThis is cool. Already something, but what I really wanted was a: CopyOnSelectAndPaste Like putty!
-
Chris Page over 12 yearsAnd so can Terminal. Edit > Paste Selection or Middle-Click if you have a three (or more) button mouse. Or drag the text a few pixels and release.
-
Chris Page over 12 years“No, you can however select the text you want and drag-n-drop…” The answer is “Yes”. You can Middle-Click to do the same thing as Edit > Paste Selection. “right-click to paste” is likely a typo; either Sergio meant “middle-click to paste” or he’s using a terminal application with a “Paste Selection” contextual menu command.
-
Chris Page over 12 yearsAs @Arjan said, Terminal can do this: Choose Edit > Paste Selection (or Shift-Comamnd-V) or Middle-Click, the latter of which I assume is what you meant by “right-click” in your original question.
-
samkass over 11 yearsReverse engineering is not illegal in the United States. Not sure what country you're posting from, though.
-
Herr Grumps almost 9 yearsRight click to paste is how it works in Putty (in windows) and I think maybe some Linux based terminal apps also. I haven't looked into it myself, but Karabiner should be able to "remap" right mouse button to middle mouse button (eg simulate a middle mouse button click) when the Terminal app has focus.
-
shams.haq about 6 yearsThanks for the middle mouse button tip! Feels like redemption!
-
Jasper de Vries almost 6 yearsThis should have been the accepted answer ;-)
-
Arjan almost 6 yearsNice. Command plus two-finger tap on the trackpad works too.
-
biesior over 3 yearsI was looking for this because wanted to enable "copy on select" however drag and drop option made me happy :p
-
Nicolas Thery almost 3 yearsDespite any plugin quality, installing terminal Third Party Plugins is a bad idea.