I have a command that outputs a lot of text that has some numbers within the output, specifically 20-digit numbers. These 20-digit numbers are identifiers to a specific web resource (like https://example.com?q={20-digit-number}.
How do I customize stdout to replace any 20-digit number with a clickable URL on iterm2 + zsh?
I've looked into creating my own oh-my-zsh plugin, but I can't seem to find a way to hook into the printed output
On iTerm2 the functionality to click on Hyperlinks using Ctrl/⌘ + click should be already included.
If instead you want to output your 20-digit-number links with a different format, I suggest you read this page on Hyperlinks in terminal emulators, especially the Quick Example.
You can also think about creating Triggers with the Make Hyperlink action whenever the text in the terminal matches one of the 20-digit-links.