Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

10.6: Google search in Terminal contextual menu System 10.6
Snow Leopard only hintSafari installs a Service which lets you use text selected in any application as a search query in Google. If you've enabled it in System Preferences » Keyboard » Services, normally the service appears in the contextual menu option when you Control-click on some text. However for some reason it doesn't show up in the contextual menu in Terminal.app. I found a way to enable it in Terminal as well.

Right click and select 'Show Package Contents' on Safari. Then edit Contents/Info.plist inside the Safari.app package. Find the section with the types of data accepted by the service:
<key>NSSendTypes</key>
  <array>
    <string>NSStringPboardType</string>
  </array>
Then add another string, 'public.utf8-plain-text', so that it now reads:
<key>NSSendTypes</key>
  <array>
    <string>NSStringPboardType</string>
    <string>public.utf8-plain-text</string>
  </array>
Now restart Safari, and refresh the Services list by running:

/System/Library/CoreServices/pbs

The 'Search with Google' option should now appear in the context menu in Terminal.app.

[crarko adds: I haven't tested this one. Note that the Google Search Service does already show up in the Services menu in Terminal without performing this change. As always, when making these changes internal to a code-signed application package, make sure you have a clean backup. I often just make a zip archive of the application before making edits to the original. Time Machine backups work, as long as you have one that predates the changes.]
    •    
  • Currently 3.33 / 5
  You rated: 3 / 5 (6 votes cast)
 
[4,821 views]  

10.6: Google search in Terminal contextual menu | 5 comments | Create New Account
Click here to return to the '10.6: Google search in Terminal contextual menu' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
10.6: Google search in Terminal contextual menu
Authored by: joeyblades on Feb 28, '11 05:34:56PM
crarko wrote:
I haven't tested this one. Note that the Google Search Service does already show up in the Services menu in Terminal without performing this change.

I noted the same thing as soon as I read the hint. Just curious - why is this posted? It seems unnecessary and potentially dangerous.



[ Reply to This | # ]
10.6: Google search in Terminal contextual menu
Authored by: riepel on Feb 28, '11 06:37:47PM

services menu != contextual menu

I spend hours per day in Terminal and I really missed the Terminal contextual menu "Search in Google" entry that existed until 10.6. "Thrilled" doesn't even begin to describe how happy I am to have it back.

Bonus: Implementing this hint brought back the "Look up in Dictionary" entry too.

Thanks you for this very useful hint.



[ Reply to This | # ]
10.6: Google search in Terminal contextual menu
Authored by: Titanium-OnyX on Mar 01, '11 11:15:40PM

Sorry, but this hint doesn't work on my system... =(



[ Reply to This | # ]
10.6: Google search in Terminal contextual menu
Authored by: riepel on Mar 02, '11 11:48:33AM

It didn't look like it worked on my system at first. I was running Terminal and not willing to restart it (too much context to lose). I did restart Safari and I ran Terminal a second time, but no joy. Later, lo and behold, the entry appeared in the Terminal contextual menu, even though I hadn't taken any further action to make it happen.

Hopefully you will find joy soon.



[ Reply to This | # ]
10.6: Google search in Terminal contextual menu
Authored by: sipatel on Mar 07, '11 04:04:53PM

So, I guess that everyone knows that whatever application you're in, if you highlight any text an hit CMD-SHIFT-L, Safari will open and do a search via Google.

I only discovered this by accident, and haven't tested this in Terminal.

Edited on Mar 07, '11 04:05:23PM by sipatel



[ Reply to This | # ]