bash 有没有办法在 OSX 终端中使链接可点击?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/2338765/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-09 18:58:27  来源:igfitidea点击:

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

bashmacosterminaltextmate

提问by japetheape

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.

我计划开发一个 Mxmlc 到 Textmate 格式化程序,将 mxmlc 错误格式化为可点击链接,因此您可以在 Textmate 中快速打开它们,因为 Textmate 有一个 url 方案,例如: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.

我想知道是否可以在您的 OSX 终端中显示链接,这些链接也是可点击的,例如通过更改 PS1 变量左右。

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

附:我不想使用在 Textmate 环境中运行的 HTML。

回答by oops

Before OSX Lion:

在 OSX Lion 之前:

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

cmd+ shift+double-click在 Terminal.app 中的 URL 上,它将在默认程序中打开。

OSX Lion:

OSX 狮子:

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

cmd+ double-click(否则您将进入全屏模式)。

回答by Paul R

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 ?

您可以右键单击终端中的 URL,上下文相关菜单中的第一个选项是“打开 URL”。不完美,但也许足够好?

回答by Paused until further notice.

Pipe your output to lynx:

将您的输出通过管道传输到lynx

your_command | lynx -use_mouse -stdin