open default with sublime doesn't seem to work #100

Closed
ohadperry opened this Issue Jan 26, 2013 · 22 comments

Projects

None yet

10 participants

istall this gem,
configured like so:

configure :development do
use BetterErrors::Middleware
BetterErrors.application_root = File.expand_path("..", FILE)
end

BetterErrors.editor = :subl if defined? BetterErrors

but it's not working. default text mate works.

Owner

Have you installed subl-handler?

tried to install.. downloaded, unzipped and opened.
but where do I ?
Select SublHandler -> Preferences..., then set the path for the subl binary.

iwan commented Jan 29, 2013

You need to have installed Xcode.
Then doubleclick subl-handler.xcodeproj, inside Xcode press "Run" and SubHandler will start.

Any solution for Linux?

thanks, subl-handler did the job once it was installed

@iwan What do you mean? The screencast just tells that you can set editor to :sublime and then proceeds to talk about rails panel.

Owner

Closing because @ohadpartuck's issue was solved.

@RKushnir - I'm not aware of any way to set this up on Linux.

@charliesome charliesome closed this Feb 7, 2013

+1 for subl-handler makes better_errors even better!

exalted commented Jul 23, 2013

I did install subl-handler too, but what it only does is to launch SublHandler.app, but it won’t open the actual SublimeText.app… Any ideas?

@exalted, I'm having the same issue with subl-handler. Any chance you are using zsh as your shell?

exalted commented Aug 13, 2013

Nope, this is bash via Mac OS Terminal.app and I’ve tried both subl-handler binary version and from Xcode project, but no luck there. I wish there was a command line to set an URI scheme to fire up with a default app instead of using subl-handler, which doesn’t seem to work anymore...

Unfortunately I didn't make any progress on this either. Do let me know if you came across a solution.

Iain

On Aug 13, 2013, at 9:48 AM, Ali Servet Donmez notifications@github.com wrote:

Nope, this is bash via Mac OS Terminal.app and I’ve tried both subl-handler binary version and from Xcode project, but no luck there. I wish there way a command line to set an URI scheme to fire up with a default app instead of using subl-handler, which doesn’t seem to work anymore...


Reply to this email directly or view it on GitHub.

exalted commented Aug 13, 2013

@iainsmith check this out and let me know if that works for you too, please.

@exalted I tried your project and it is registered correctly (only one binding to subl, it launches on an subl:// url) but it does not work either.

Correction: I was using the subl-handler test string and THAT failed. HOWEVER My better error URL worked. It appears that i CAN NOT get yours to work using the open command in the terminal; but my better errors works.

If I paste this into Chrome's address bar then it will open it on my machine (this file should be on everyones machine to test): subl://open?url=file://%2FApplications%2FMail.app%2FContents%2FInfo.plist&line=1

I was able to get this working yesterday with better errors. Are you clicking the link in your browser, when better errors activates?

On Aug 14, 2013, at 4:07 PM, Andrew Burns notifications@github.com wrote:

@exalted I tried your project and it is registered correctly (only one binding to subl, it launches on an subl:// url) but it does not work either.


Reply to this email directly or view it on GitHub.

@iainsmith I corrected my above answer.... it is a problem with launching subl:// urls from the shell.

exalted commented Aug 14, 2013

@ErebusBat @iainsmith yea, I don’t expect (nor tested) via open, but better_errors are expected to work. 👍

I'm having a similar issue as stated by some other people above. Trying to open a link just opens SublHandler and nothing else. I've triple checked my path to the binary. Frustrating.

shock commented Jun 25, 2014

In case it helps anyone else, I had the same problems as many others above with SublHandler. I tried @exalted's handler, and it didn't work either. I finally figured out a solution for my environment, though, so I thought I'd share.

Unlike SublHandler, @exalted's handler worked great the first time I installed it in Firefox and Safari, but for some reason not in Chome (I'm Mac OS Mountain Lion, dev Chrome release), so I went back to trying to get SublHandler working. Previously, I had the same problem as @exalted with SublHandler as described above, it would just open itself, but not open the file in Sublime. At least it was getting handled by Chrome. I finally figured something out thanks to this post: https://stackoverflow.com/questions/9435075/how-can-i-make-rails-footnotes-open-files-using-sublime-text-2/11619954#11619954. Turns out the problem was two-fold.

Here are the notes on how I got things working in my environment. Chrome on my machine doesn't recognize the subl:// "protocol" (it just searches Google), but it does recognize the txmt:// protocol passing it to the configured handler. I have no idea why, but I sought out a way to trigger @exalted's handler using the txmt:// protocol and it worked. Here's what I did, based on the info from the link above:

  • Installed @exalted's handler
  • Installed RCDefaultApp
  • Went to the URLs tab of RCDefaultApp, and discovered that the txmt handler was still bound to TextMate itself (I'm a former TM user).
  • In RCDefaultApp, I changed the Application that handles txmt to Sublime Text 2 Launcher.
  • In my custom app, I was trying to use subl:// as the protocol, which as I said doesn't work in Chrome for some reason, so I changed my app back to using txmt://
  • Voila. Now everything works. txmt:// URLs open files in Sublime

I also got the same solution working using SublHandler as the handler, but I like @exalted's handler better because it doesn't open an application in the foreground like SublHandler does.

Thanks, @exalted! And also everyone else for the clues the lead me to this solution.

exalted commented Jun 25, 2014

🍷

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment