OSC 8 detection / support
Clickable URIs/links in terminals is a standardized thing: https://github.com/Alhadis/OSC8-Adoption
Detect that support (e.g. using ANSI cursor position request) and set a console flag for the session. Then allow custom strings when supported or use @-codes to do the special expansion when displaying URLs.