Is there a way to make a link clickable in the OSX Terminal?

巧了我就是萌 提交于 2019-12-20 08:01:07

问题


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:


Before OSX Lion:

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

OSX Lion:

cmd+double-click (otherwise you will enter fullscreen mode).




回答2:


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 ?




回答3:


Pipe your output to lynx:

your_command | lynx -use_mouse -stdin


来源:https://stackoverflow.com/questions/2338765/is-there-a-way-to-make-a-link-clickable-in-the-osx-terminal

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!