Modern terminals support hyperlinks, which are quite convenient, and can be opened with Ctrl + click or Cmd + click
Here's a simple command to try out the feature. The result is equivalent to this HTML link: This is a link
echo -e "\e]8;;https://example.com\e\\This is a link\e]8;;\e\\"
You can also use the function to create links:
hyperlink() {
echo -e "\e]8;;$1\e\\$2\e]8;;\e\\"
}
hyperlink "https://example.com" "Text with hyperlink"
Output:
If this instruction was useful to you - put a star ⭐ :)