views:

251

answers:

3

I am planning on developing an Mxmlc to Textmate formatter, one that formats mxmlc errors as clickable links, so you can open them up quickly in Textmate as Textmate has a url scheme e.g.: txmt://open/?url=file://~/.bash_profile&line=11&column=2.

I am wondering if it is possible to display links in your OSX terminal, that are also clickable, e.g. by changing the PS1 variable or so.

ps. I don't want to use HTML that runs in the Textmate environment.

+1  A: 

You can right click on a URL in Terminal and the first option in the context-sensitive menu is "Open URL". Not perfect, but maybe good enough ?

Paul R
No as it must serve my development cycle this won't be fast enough. The best solution would be displaying only a text, with a link behind it that is not displayed, however as far as my bash/sh knowledge goes, I think this is not possible, hope you prove me wrong ;-).
japetheape
A: 

Pipe your output to lynx:

your_command | lynx -use_mouse -stdin
Dennis Williamson
I tried this: echo "<a href=\'http://test.com\'>Test</a>" | lynx -use_mouse - stdinThis opens lynx, this is not what i want, I want the output directly in my terminal.
japetheape
Bash won't do it. I don't know why PS1 should have anything to do with it. I don't believe Bash has any mouse support whatsoever. If Terminal.app only does it with a right click, then your only other option may be if you can write an AppleScript that will provide that functionality more directly. Or magic.
Dennis Williamson
Ok already thought so, thanks for the suggestions however!
japetheape
+6  A: 

cmd+shift+double-click on a URL in Terminal.app and it will open in the default program.

oops
+1 Cool - that's neater than my right click -> Open URL suggestion.
Paul R
Ahh that's the best answer! Thanks!
japetheape