I see some graphical shell environments allow you to click hyperlinks appearing in text output from running applications.
I would think that outputting anything http://... like wo开发者_StackOverflow社区uld probably make a clickable link, but are there any other standards/mechanisms I should look at? Ideally I would like to do linktext and have "linktext" appear as clickable.
I'd appreciate something cross-platform compatible with appropriate fallback mechanisms, and I'll read any programming language but prefer java.
If you are using cygwin's mintty shell (Windows environment's Linux-like shell), you could Ctrl+click
on any plain text that is URL or (possibly relative) file path, but without spaces in between.
E.g. in mintty shell, type "http://google.com" OR "path/to/file.txt" (relative to current directory) and Ctrl+click
on the text. It will open the URL or the file by your default application.
There are different software layers messed up together in your question. The shell layer is cross platform compatible which is assured by standard as POSIX. But the "shell window", how you call it, is accomplished by particular terminal - like linux console (which is not window at all), xterm, windows putty, gnome-terminal etc. At this level, there is nothing like compatibility, on the contrary, it's complete diversity. I know that gnome-terminal had this feature you wanted - one was able to configure which characters are still part of the link and which do not. But you hardly achieve a compatibility here, unless the particular terminal is available for all the platforms...
精彩评论