-
Notifications
You must be signed in to change notification settings - Fork 365
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Clickable links in opam show #4568
base: master
Are you sure you want to change the base?
Conversation
Allows generation of OSC 8 sequences for clickable hyperlinks.
try | ||
let basic_contents = detail_printer ~prettify:true ?normalise ~sort st nv item in | ||
let contents_url = OpamUrl.parse basic_contents in | ||
if OpamUrl.(contents_url.transport = "http" || contents_url.transport = "https") then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A reason to not use the backend
field ?
@@ -442,6 +442,12 @@ let carriage_delete = | |||
else | |||
carriage_delete_unix | |||
|
|||
let url ~ref ~label = | |||
if not (color ()) || Sys.win32 && get_win32_console_shim `stdout Mode = Shim then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might be worth a comment linking to the handy https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3cb5feda which describes the escape codes for Linux
A piece of sleeplessness-induced silliness looking at #4565 - if a field in opam show parses as a URL, turn the field marker into a clickable hyperlink.
Not for 2.1 (if at all, but the function might be useful, even if not used in opam show)