Open avdv opened 1 year ago
Thanks for the diff. What does this flag do on terminals that don't support it? I'm wondering if the answer is there is nothing harmful, we could just always emit the hyperlink if we are emitting ANSI codes anyway and not even have a flag?
Yes, a terminal emulator should just ignore ANSI escape sequences it does not recognize / support.
But when does hoogle emit ANSI codes? From a quick look, it never does that. E.g. the --color
/ --colour
flag seems to have no effect (I couldn't find any usage of color
in the code base except in CmdLine.hs
).
And the CI seems to fail for an unrelated reason. Or do I have to update copyright years maybe?
Add
--hyperlink
flag to search sub command which outputs ANSI escape sequences that supporting terminal emulators can leverage to show hyperlinked text.Rendered help text:
The effect depends on the terminal emulator used; I am using kitty and it underlines hyperlinked text with a squiggly line. A simple left click opens the default application for the link:![2023-03-12_15-59](https://user-images.githubusercontent.com/3471749/224553663-c6cc6e58-eeac-4cf9-af07-dcd240688fec.png)
See https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3cb5feda for more info.