jezdez / textmate-missingdrawer

[UNMAINTAINED] A better sidebar for Textmate.
MIT License
724 stars 35 forks source link

Terminal button and new tabs #59

Closed brief closed 12 years ago

brief commented 12 years ago

Tweaked the Terminal button to check for a Terminal process. If Terminal is already running, opens a new tab in the frontmost window (as before). If not, activates Terminal without creating a new tab.

Works for me, but may not be the desired behaviour in light of Lion's new "restore windows" feature.

jezdez commented 12 years ago

Sounds like a good idea, but I'd prefer this to be an option in the preference pane, e.g. "Open terminal in tab" or something similar.

brief commented 12 years ago

I agree, but it may no longer be necessary to do so under Lion. Finally upgraded over the weekend and found that the existing AppleScript behaves differently with restore windows enabled.

If Terminal has no window states saved, it works much like my pull request -- Terminal is first activated without a tab, while subsequent uses of the Terminal button creates new tabs in the frontmost window.

When restoring windows, however, Terminal opens a new window when first activated. Using the Terminal button again works as expected, creating new tabs in the frontmost window.

My revised AppleScript breaks under Lion (can't seem to use a restored window as the frontmost window), so I'm closing this pull request.