InputManagers on Leopard

Contrary to most rumors, input managers still work on Leopard (at least on my pre-GM seed), but for an input manager to be loaded there are now a few requirements it needs to fulfill.

This is taken from the ApplicationKit release notes:

  1. The valid installation is now restricted to the /Library/InputManagers folder only. Bundles in other locations are silently ignored.

  2. All the files in the bundle and /Library/InputManagers folder itself must be owned by the root user and admin group. No files inside the bundle can have group or other write permissions.

  3. Processes running with the root privilege (getuid() == 0 or geteuid() == 0) cannot load any bundle input manager.

  4. Processes running with the wheel group privilege cannot load any bundle input manager.

  5. The process must be in the active workspace session at the time of loading the bundles.

  6. The process must not be tainted by changing user or group id (checked by issetugid()).

  7. No 64-bit processes can load any bundle input managers.

First item says that other locations are silently ignored, this however has not been my experience. I had to remove ~/Library/InputManagers before I got mine working (presumably I could have settled with removing the contents of that folder).

So if you want Edit in TextMate to work on Leopard, here is what to run from Terminal (assuming TextMate.app is in /Applications):

# Remove old version
rm ~/Library/InputManagers/Edit\ in\ TextMate

# Create InputManagers folder
sudo mkdir /Library/InputManagers

# Copy the input manager to /Library
sudo cp -pR /Applications/TextMate.app/Contents/Resources/Edit\ in\ TextMate /Library/InputManagers

# Ensure everything is owned by root
sudo chown -R root:admin /Library/InputManagers

A downside with this (apart from the hassle) is that this is deep-copying the input manager, so when it gets updated, you need to make a new full copy to /Library/InputManagers to get the improvements.

Also, Apple writes in the same release notes that:

The automatic loading of bundles located in InputManagers folders is now officially unsupported […] This functionality is likely to be disabled in a future release.

So for how long they will stay around is unknown.

56 Comments

  1. 26 Oct 2007 | # Jay wrote…

    when release textmate2 for leopard? and navtive cjk inputs?

  2. 26 Oct 2007 | # Wim Leers wrote…

    No 64-bit processes can load any bundle input managers.

    Does this mean InputManagers don't work at all in 64-bit Leopard?

  3. 27 Oct 2007 | # Leopard In-compatibility List - The Apple Blog Community wrote…

    [...] still work, but in a different way. I'm worried that they'll be gone in the future, though. See this. __________________ Guy in the [...]

  4. 27 Oct 2007 | # Jacob Rus wrote…

    Jay: ask him again in several months. :)

  5. 27 Oct 2007 | # gyurisc wrote…

    I could not wait several months. please release it soon! :)

  6. 27 Oct 2007 | # James Cornell wrote…

    Wim, it means 64-bit cocoa applications cannot be hooked. It can hook legacy applications, 32-bit compiled cocoa apps, and some system components, but if it's 64-bit it won't work with it. Sound like they've actually made code signing and sandboxing work in 10.5. I wouldn't know, I won't have it for a few days. TextMate 2.0 will come out eventually

    Allan could not test TextMate for the GA of Leopard because Apple wouldn't even let the developers get the final version, they had to wait until last night. I'm sure Allan's been doing work on his seed though.

    Allan, are you still making TextMate 2.0 free for existing users who migrate to Leopard?

  7. 27 Oct 2007 | # Erik van Eykelen wrote…

    If TextMate 2.0 is really going to be free for existing users, why don't we (existing users) raise money for a charity to be picked by Allan?

    I use TM professionally day in day out, I would gladly pay $100 for an upgrade. @Allen: I'm the first contributor!

  8. 27 Oct 2007 | # Nigel Metheringham wrote…

    I also had to remove the ~/Library/InputManagers directory before this method worked (on a DVD copy of Leopard).

  9. 27 Oct 2007 | # Jozef Remen wrote…

    I can't get it to work. Inquisitor and SafariSource works fine but Edit in TextMate does not, it's not even visible in Edit menu of any app. Tried to logout, changed permissions, nothing helps. As I have said, other Input Managers are working well.

  10. 27 Oct 2007 | # Marco wrote…

    You rock. This made my Inquisitor work again, properly.

    I found that while PimpKit worked, it was a bit of a hack requiring a certain MIME type to be needed on a page before it'd work. PlugSuit loaded inquisitor partially (?) so it couldn't be configured.

    Regular inputmanager loader: flawless. Thanks.

  11. 27 Oct 2007 | # Anonymous wrote…

  12. 27 Oct 2007 | # Computing@Thayer blog : Leopard - First Take :: Thayer School of Engineering at Dartmouth wrote…

    [...] are deprecated in Leopard and may be removed in future releases. There's a blog post here with a potential workaround, but I haven't tried it myself. I may try Privoxy to see if it [...]

  13. 27 Oct 2007 | # Wim Leers wrote…

    Thanks for the explanation James!

  14. 28 Oct 2007 | # Leopard - 1. Tag | kopflos wrote…

    [...] wenn der Entwickler schon fleißig an der Leo-kompatiblen Version arbeitet) setzen auf die angeblich nicht mehr vorhandene Möglichkeit Input Manager zu nutzen und versagen standardmäßig Ihren Dienst. Hier gibt es aber mit PlugSuit bereits eine [...]

  15. 28 Oct 2007 | # Leopard und Erweiterungen (SIMBL, InputManager) at zHome wrote…

    [...] InputManagers on Leopard [...]

  16. 28 Oct 2007 | # Pimpkit: Instalar extensiones en Safari 3 (Leopard) « intemperie wrote…

    [...] el creador de Inquisitor, acaba de postear en su blog algo que nos alegra a muchos: Finalmente Apple no nos ha capado tanto como pensábamos y al menos Inquisitor funciona perfectamente en la versión final de Leopard, eso sí, sólo en su [...]

  17. 28 Oct 2007 | # How are you blocking ads with Safari 3 on Leopard? - MacNN Forums wrote…

    <

    p>[...] 3 but it has not blocked any ads yet eventhough it's enabled. I followed the instructions here: TextMate Blog

  18. 28 Oct 2007 | # skraatz.de » Mac OS X Leopard - Ersteindrücke wrote…

    [...] dann – in den Einstellungen taucht Saft aber auf). InputManagers sollen weiterhin mit dieser Information laufen, Saft habe ich damit aber noch nicht wieder reaktivieren [...]

  19. 28 Oct 2007 | # X-Admin » Dem Leoparden Flöhe in den Pelz setzen wrote…

    [...] bestimmten Voraussetzungen doch unter Mac OS X 10.5 Leopard laufen. Die genauen Vorgaben werden ein TextMate Blog beschrieben. Muss ich dann mit dem GM von 10.5 mal [...]

  20. 28 Oct 2007 | # Inquisitor für Leopard wrote…

    [...] die über Input Manager verwendet wurden, erhöht wurde. Die genauen Bedingungen lassen sich im TextMate Blog nachlesen. Deswegen gibt es seit heute das kostenlose Pflichtool Inquisitor, dass Safari um eine [...]

  21. 28 Oct 2007 | # John Whitley wrote…

    Why not just use a symlink in /Library/InputManagers instead of the deep copy? That neatly avoids the manual update problem:

    sudo ln -s /Applications/TextMate.app/Contents/Resources/Edit\ in\ TextMate /Library/InputManagers/Edit\ in\ TextMate

  22. 29 Oct 2007 | # George Coller wrote…

    I have the official Leopard release installed. The workaround using doesn't seem to work for me. Maybe they changed something between pre-GM and the shrink-wrap version.

    I can understand if this was a security issue – hopefully Apple didn't just do it to be mean :-)

  23. 29 Oct 2007 | # Christopher Mitchell wrote…

    Not working here either. Running the retail version of Leopard. Any suggestions?

  24. 29 Oct 2007 | # Matasano Chargen » A Roundup Of Leopard Security Features wrote…

    [...] Input managers are bundles that are loaded into all running programs. Originally intended for the mundane tasks of internationalization and accessibility, they've mutated into a generic plugin facility for all Cocoa programs. If you're using things like SIMBL, Saft, SafariStand, Sogudi, or Pith Helmet, you're abusing input managers. Leopard "breaks" them. [...]

  25. 30 Oct 2007 | # Allan Odgaard wrote…

    I am now on GM and input managers still work for me.

    If you have a problem try:

    # remove all local input managers
    rm -rf ~/Library/InputManagers
    
    # set permissions properly on system wide input managers
    sudo chmod -R go-w /Library/InputManagers
    sudo chown -R root:admin /Library/InputManagers
    

    Notice I also do a chmod here. I didn’t do that in my blog post, since I figured the default permission flags should be fine, but maybe this is your problem.

    John: The symbolic link will require a sudo chown after each upgrade of TextMate, so it’s not an ideal solution.

    Erik/James: Yes, 2.0 remains a free upgrade, whenever it comes out (Jay: there is no ETA, let me promise that when I have an ETA, I will announce it wide and broad, so in the meantime there is no need to ask about it ;) ).

  26. 30 Oct 2007 | # Zettt wrote…

    Thanks Allan for the Update.

    You are my greatest hero ;)

  27. 30 Oct 2007 | # George Coller wrote…

    Allan, that did the trick for me too. Thanks much everyone.

    Now if only I could figure out the 2-3 other programs that Leopard funked up.

  28. 30 Oct 2007 | # douglas adams wrote…

    "The automatic loading of bundles located in InputManagers folders is now officially unsupported […] This functionality is likely to be disabled in a future release."

    So what is the replacement going to be?

  29. 30 Oct 2007 | # John H wrote…

    Dumb question time: What is a "workspace session"? Does that mean all processes parented by an individual login? And to be active means that the user is the one currently switched in at a gui?

  30. 31 Oct 2007 | # Caffeinated Cocoa » Blog Archive » Caffeinated Cocoa + Leopard wrote…

    [...] of them all together. (UPDATE: Oops, I guess they are still loaded in Leopard, but with a bunch of added restrictions. Also, there is a release not saying they are not supported, and might not be loaded in the [...]

  31. 31 Oct 2007 | # Mikael wrote…

    Reading through this security overview: http://www.matasano.com/log/981/a-roundup-of-leopard-security-features/ I to ask, is it wise to use the Input Manager? "Input managers are terrifying. They’re arbitrary blobs of code that get injected into almost every Mac application. They are a “UI extension interface” in the same way that Back Orifice 2k is a “remote system administration facility”."

  32. 31 Oct 2007 | # Allan Odgaard wrote…

    Mikael: If you like the functionality they provide, sure, you should run them.

    TextMate itself is also an arbitrary blob of code that gets run (presumably almost every time you turn on your mac) and it has (write) access to your entire home folder ;)

    The difference is only that TextMate is confined to a single process so if the code is bad (in a non-malicious way) it likely will only take down that single process.

    Something like Edit in TextMate though gets loaded into all Cocoa applications, so if the code is bad (i.e. causing crashes) then it can possibly affect all your Cocoa applications. But the same can be said about all the system frameworks, is not related to security (but rather stability), and if you didn’t get any crashes from installing it, is a hypothetical argument.

    The security argument is more along the lines of, Acme Inc. ships AppExtreme and digitally signs it. You trust Acme Inc. and allows AppExtreme to access your credit card number (stored in the KeyChain). The operating system uses the digital signature of AppExtreme to verify that it really is from the same vendor as the one you initially said you trusted.

    Later you get NastyApp from Vertigo Corp., you want to run it, you trust it enough to run it (and have it potentially harm your entire file system) but you do not trust it enough to allow it to read your credit card number (from the KeyChain).

    Now in the past, NastyApp would be able to install an input manager when launched, and the next time you run AppExtreme, NastyApp’s code will run, and it can then access your credit card number since the system believes the code falls under what was signed by Acme Inc.

    So to summarize, the security concern as I see it was that one vendor could exploit the trust given to another vendor, by installing an input manager behind your back.

  33. 02 Nov 2007 | # Thomas H. Ptacek wrote…

    For definitions of "vendor" that include "authors of malware", yeah, I think you're on the money there, Allan. :)

  34. 02 Nov 2007 | # innovation initiative » Blog Archive » Leopard: Pimpin' Safari with InputManagers wrote…

    [...] completely removed from Leopard. But thankfully as Allan Odgaard of Macromates points out in his blog, that's not (quite) the [...]

  35. 04 Nov 2007 | # Plugins InputManagers anche in Safari 3.0.4 wrote…

    [...] guida è tratta da Textmate Aggiungi a del.icio.us 2 Views ZN utilizza WordPress Revolution v4.1 basato su iTheme di [...]

  36. 06 Nov 2007 | # Inquisitor und andere InputManager unter 10.5 Leopard - apfelquak wrote…

    [...] steht mit der neuen Version von SafariStand bereit. Eine Ausführliche Beschreibung kann im TextMate-Forum nachgelesen werden.   Gequakt von TheMaverick | Abgelaicht in Apple, Tutorials, Web, [...]

  37. 07 Nov 2007 | # Ken wrote…

    Thanks for the heads up! I went into some more detail about Input Managers on Leopard on our blog here: http://macdaddyworld.com/ -Ken

  38. 09 Nov 2007 | # SafariPlus on Leopard at candleshoe wrote…

    [...] Whether that's down to changes to how Input Managers are handled in Leopard or something else I don't know. (Input Managers aren't, as earlier thought, totally banished in Leopard, they just operate under tighter restrictions.) [...]

  39. 21 Nov 2007 | # InputManagers in Leopard - Martin Probst's weblog wrote…

    [...] In Leopard, InputManagers need to be installed in /Library and owned by root, for security reasons. Tutorials how to re-enable them can be found e.g. on Mac OS X hints or in the TextMate blog. [...]

  40. 01 Dec 2007 | # The Mac applications I use and recommend : hasseg.org wrote…

    [...] Leopard update:Still using Safari 3, only it's not in beta anymore. InputManagers are still working, albeit in a more secure way. [...]

  41. 06 Dec 2007 | # Chax » Blog Archive » Chax 2.1 Beta 1 wrote…

    [...] of Chax from ~/Library/InputManagers. Anyone still experiencing trouble should take a look at Allan Odgaard's write-up on setting permissions correctly so that Input Managers will [...]

  42. 09 Dec 2007 | # links for 2007-12-09 « Amy G. Dala wrote…

    [...] TextMate Blog » InputManagers on Leopard (tags: osx software leopard textmate) [...]

  43. 09 Dec 2007 | # JiHO wrote…

    Apparently, no file inside the bundle can be executable either. This causes many input managers to fail despite of every precaution taken above since, very often, the file inside Whatever.bundle/Contents/MacOS/ is executable. Changing this requires more than a chmod -x since directories need to be "executable". So find comes to the rescue find . -perm u=rwx,go=rx -type f to find those offending files, if any. And sudo find . -perm u=rwx,go=rx -type f -exec chmod -x \{} \; to change their permissions.

    Maybe this deserves an edit of point number 2 in the checklist.

  44. 16 Jan 2008 | # Ubiquitous of TextMate (Text Editor for Mac) in Cocoa Applications - MacTips: OS X Tips and Tricks wrote…

    [...] # Remove old version rm ~/Library/InputManagers/Edit in TextMate # Create InputManagers folder sudo mkdir /Library/InputManagers # Copy the input manager to /Library sudo cp -pR /Applications/TextMate.app/Contents/Resources/Edit in TextMate /Library/InputManagers # Ensure everything is owned by root sudo chown -R root:admin /Library/InputManagers[ Via: TextMate Blog] [...]

  45. 17 Jan 2008 | # The Ringtail || Blog Archive » 3(ish) things about Textmate wrote…

    [...] Because I am so used to Textmate now, with all it's navigation niceness and snippets and such, I don't like to use any other apps to create more than a couple of lines of text. Textmate provides an input manager called 'edit in textmate' that allows you to work on text from any cocoa application right in Textmate. If I'm writing an email that goes longer than a few lines I can hit ctrl-cmd-e and open the text in Textmate. Once I'm done I just save the file and close it and I am taken back to Mail with the text all ready to go in my message. There is a command in the Textmate bundle to install this but you need to do something slightly different to install in Leopard – see here for Leopard install instructions. [...]

  46. 20 Feb 2008 | # Ciarán Walsh’s Blog » Glyph input manager wrote…

    [...] be sure to follow these instructions if you are on [...]

  47. 24 Jun 2008 | # sushi-k.com » Blog Archive » incremental search for cocoa wrote…

    [...] on OS X. I had problems getting it to work on leopard until I discovered some Leopard-specific issues with input managers. What I ended up doing [...]

  48. 13 Nov 2008 | # Edit in TextMate in Leopard - Platform Peace wrote…

    [...] The "Edit in TextMate" feature (part of the TextMate TextMate bundle) lets you call upon TextMate to edit text fields in other applications. However, following the instructions in the TextMate bundle was not working. It turns out this is due to a change in how Leopard handles Input Managers. Here are the steps you need to take to enable the "Edit in TextMate" feature in Leopard. [...]

  49. 22 Nov 2008 | # Ivan Choo - Google Gears for Safari Fix wrote…

    [...] URL requests and provide data if necessary. The problem is that Apple has limited the use of Input Manager in Leopard by imposing more restrictive rules as a security measure, one of which is processes running with [...]

  50. 20 Jan 2009 | # Blogging sequentially using Writeroom, TextMate and ecto or MarsEdit wrote…

    [...] the way I blog. Footnotes:I used to do this seamlessly using Library Input Managers such as the bundle developed by TextMate. But since Leopard these are unofficially unsupported by Apple, apparently [...]

  51. 04 Sep 2009 | # Stan wrote…

    Just had to install TextMate from scratch on the new MBP on 1.5.8 and cannot get it work, the Edit in TextMate extension. I had it working on the old MBP with the same version of OS X. The "Edit in TextMate" appears in the Edit menu of Cocoa apps but once you activate either with key shortcut or directly from menu nothing happens.

    Tried all the mentioned methods from the post and comments, no luck. Other InputManagers like SafariStand, SafariBlock, Chax, Glims and 1password work all correctly.

    Any ideas? thanks in advance

  52. 06 Sep 2009 | # Allan Odgaard wrote…

    Stan: No idea what goes wrong, but I have heard about it a couple of times before.

    I can only suggest the normal troubleshooting measures, like testing if this is a local problem (by creating a new account), resetting launch services database (as it might be, that the input manager can’t reach TextMate), and whatever else you can think of.

    Ideally someone with C/Objective-C skills would insert some debug output into the input manager (which I released as F/OSS).

  53. 08 Sep 2009 | # Stan wrote…

    Thanks Allan. Might be out my usual scope of understanding But I will a try and use more google to find a solution. Thanks again.

  54. 07 Oct 2009 | # Uğur Özyılmazel wrote…

    hi!, well, "edit in TextMate" is not working… Any chance to fix this? i know , many people has some issues with that… i tried lotsa stuff and still now working…

  55. 07 Oct 2009 | # Allan Odgaard wrote…

  56. 07 Oct 2009 | # Uğur Özyılmazel wrote…

    well, i used latest build of "Edit in TextMate" and it worked… Thanx Allan!

Comments closed, you can use the mailing list for discussion.