I'm not posting to this site anymore. For continued nerdiness, head on over to thomasborowski.de.

August 1, 2011

TerminalColours SIMBL plugin under Lion

If, after upgrading to Lion, the TerminalColours SIMBL plugin doesn’t load anymore (you get an error informing you that SIMBL didn’t load the plugin due to it not having been tested with Terminal 2.2 (v297)), here’s a quick tip to get it working again.

The TerminalColours 1.0 plugin actually works just fine under Lion. The error message is merely stating that the Lion’s version of Terminal.app is greater than the maximum version number the plugin was designed to work with. This maximum version number is 280 and Terminal.app in Lion is 297. So, as a precaution, SIMBL doesn’t load the plugin.

All you need to do to get TerminalColours working again, is increase the maximum version number to 297 in its .plist file. Here’s how, step by step:

  1. Quit Terminal.app.
  2. Open a Finder window and navigate to ~/Library/Application Support/SIMBL/Plugins (if you don’t see your user’s Library folder in Finder, open a Terminal window, paste this code and press Enter: chflags nohidden ~/Library ).
  3. Make a backup of the file TerminalColours.bundle by selecting it and then selecting File->Duplicate from the menu (just in case things go wrong).
  4. Right-click the file TerminalColours.bundle and select Show Package Contents.
  5. Click on Contents and double-click the file Info.plist. You can edit this file with any plain-text editor, such as TextEdit, or you can use the plist editor included in Xcode (which you can get for free on the Mac App Store).
  6. In your text editor, find the text string <key>MaxBundleVersion</key>.
  7. Immediately below that line is a line similar to <string>280</string> (the actual number may differ).
  8. Change whatever number is there to 297.
  9. Save the file (make sure to save it as plain text!).

Now, when you launch Terminal, SIMBL shouldn’t complain and your Terminal colors should work as expected.

Potentially Related

Follow the author on Twitter
  • http://davesquared.net David Tchepak

    Thanks for this! Worked perfectly for me. :)

  • http://www.michaelkerley.net Michael Kerley

    Worked great for me too – thanks!

    • http://www.michaelkerley.net Michael Kerley

      I spoke too soon. A few seconds into a Vim session, Terminal crashed and complained about TerminalColours. I ended up removing the plugin and recreating my color scheme using Lion’s built-in ANSI color support.

      • Alpha

        i had got the same error when opening vim in teminal.

      • George

        > using Lion’s built-in ANSI color support.

        I’ve uninstalled and run with this option, seems much easier, also, double click the TerminalColours themes and they open and add just fine to Terminal’s settings lists.

      • http://profiles.google.com/oscarvillarreal14 Oscar Villarreal

        Same here

  • Simon Skov Boisen

    Still getting the error-box when opening terminal, but the colors are correct though.

  • Simon Skov Boisen

    Nevermind that was due to the duplicated .bundle – works perfectly!

  • Pingback: How can I customize my terminal colors in Mac OS X Lion? - Quora

  • Tory

    Worked great thanks! I would just add a 10th step which is to remove the duplicated bundle file created during step 3.

  • Jochen

    Is this tweak still working? For somehow it does not work. My Info.plist:

    BundleIdentifier
    com.apple.Terminal
    MaxBundleVersion
    298
    MinBundleVersion
    237

    I also tried 297 but thought it might work using a higher max value.

    Any Ideas?

    • Will

      I think with the recent Lion update you’ll need to bump it up to 299.

      • Shay

        Correct, Terminal 2.2.1 needs the MaxBundleVersion increased to 299.

  • Steve

    i dont have a SIMBL directory under Application Support. i have this problem. do i need to create it new?

    • Steve

      i found it under /Library, not ~/Library. thanks!

      • http://profiles.google.com/oscarvillarreal14 Oscar Villarreal

        Nice comment, I had the same issue! thanks!

  • http://www.bdarfler.com bdarfler

    This works but when I ssh to a machine and open up a file with VI I get the following error in the console.

    1/6/12 2:32:15.101 PM Terminal: -[__NSCFNumber hasSuffix:]: unrecognized selector sent to instance 0x6e69625f62757473

    1/6/12 2:32:15.105 PM Terminal: (
    0 CoreFoundation 0x00007fff919e5286 __exceptionPreprocess + 198
    1 libobjc.A.dylib 0x00007fff88951d5e objc_exception_throw + 43
    2 CoreFoundation 0x00007fff91a714ce -[NSObject doesNotRecognizeSelector:] + 190
    3 CoreFoundation 0x00007fff919d2133 ___forwarding___ + 371
    4 CoreFoundation 0x00007fff919d1f48 _CF_forwarding_prep_0 + 232
    5 TerminalColours 0x00000001132dea06 -[NSObject(TTProfile_TerminalColours) TerminalColours_TTProfile_valueForKey:] + 44
    6 TerminalColours 0x00000001132ded7b -[NSView(TTView) TerminalColours_colorForANSIColor:] + 72
    7 Terminal 0x000000010f7027e7 Terminal + 387047
    8 Terminal 0x000000010f6c742a Terminal + 144426
    9 Terminal 0x000000010f6c69ba Terminal + 141754
    10 AppKit 0x00007fff8e673fdf -[NSView _drawRect:clip:] + 3758
    11 AppKit 0x00007fff8e6a18c4 -[NSView _recursiveDisplayAllDirtyWithLockFocus:visRect:] + 1583
    12 AppKit 0x00007fff8e6715ba -[NSView _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:] + 1032
    13 AppKit 0x00007fff8e67286f -[NSView _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:] + 5821
    14 AppKit 0x00007fff8e67286f -[NSView _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:] + 5821
    15 AppKit 0x00007fff8e67286f -[NSView _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:] + 5821
    16 AppKit 0x00007fff8e67286f -[NSView _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:] + 5821
    17 AppKit 0x00007fff8e67286f -[NSView _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:] + 5821
    18 AppKit 0x00007fff8e670ab3 -[NSThemeFrame _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:] + 270
    19 AppKit 0x00007fff8e66bec9 -[NSView _displayRectIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:] + 4755
    20 AppKit 0x00007fff8e66493e -[NSView displayIfNeeded] + 1676
    21 AppKit 0x00007fff8e66407d _handleWindowNeedsDisplayOrLayoutOrUpdateConstraints + 648
    22 CoreFoundation 0x00007fff919a4f37 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 23
    23 CoreFoundation 0x00007fff919a4e96 __CFRunLoopDoObservers + 374
    24 CoreFoundation 0x00007fff9197a159 __CFRunLoopRun + 825
    25 CoreFoundation 0x00007fff91979ae6 CFRunLoopRunSpecific + 230
    26 HIToolbox 0x00007fff8f23d3d3 RunCurrentEventLoopInMode + 277
    27 HIToolbox 0x00007fff8f24463d ReceiveNextEventCommon + 355
    28 HIToolbox 0x00007fff8f2444ca BlockUntilNextEventMatchingListInMode + 62
    29 AppKit 0x00007fff8e6283f1 _DPSNextEvent + 659
    30 AppKit 0x00007fff8e627cf5 -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] + 135
    31 AppKit 0x00007fff8e62462d -[NSApplication run] + 470
    32 AppKit 0x00007fff8e8a380c NSApplicationMain + 867
    33 Terminal 0x000000010f6a51a4 Terminal + 4516
    )

    • Anonymous

      The plugin (or SIMBL) seems to be causing some issues in some scenarios. I’ve uninstalled it and now just use Terminal.app’s built-in support for ANSI colors.

  • JP Lew

    I just updated to 10.7.3, and had to bump the MaxBundleVersion to 305 to get it working.

  • http://twitter.com/fyrabanks The Space God

    I know I’m late to the party, but the whole reason TerminalColours exists is to allow ANSI color customization for profiles, which is a native feature of Lion’s Terminal.app–so I’m not so sure I understand the point of this exercise. If you aren’t terminally lazy, it’s much cleaner (read: not a hack) either to set ANSI values through the native GUI, or to convert your old theme’s key/data pairs to the new, native standard (e.g., brightBlackColor->ANSIBrightBlackColor).

    Todd Werth’s IR_Black theme is a good example of switching to native (see http://blog.toddwerth.com/entries/13).

Previous post:

Next post: