Ezekiel Templin's Blog

Git, TextMate, and iTerm2 Sessions

I use TextMate to write my git commit messages. I also use (and love) the iTerm2 Hotkey/Visor window. For the past few months, after saving and closing the commit in TextMate, a new iTerm2 session would launch.

This new session looked like a hotkey window, but didn’t behave like one and effectively masked the actual Visor. If you’re reading this, you’ve likely experienced this issue, so you know how annoying it can become during a long work session.

Fortuantely, the solution to this problem was posted nearly a year ago by TextMate creator Allan Ossgard in response to an issue on iTerm2’s Google Project page:

It uses GetFrontProcess() when initially invoked and then SetFrontProcess() with the obtained process serial number when it is time to return focus to the terminal.

I suggest the user … reset the launch services database: /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister -kill

This worked for me. I hope it works for you too.