Clickable hyperlinks

Tim Chase python.list at tim.thechases.com
Mon Jan 9 08:53:13 EST 2017


On 2017-01-09 05:00, Deborah Swanson wrote:
> Code does in fact have the power to control what happens
> in the console. How do you think Linux does it on their terminals
> with clickable links? Granted, the code may have to specify
> parameters for a particular console, but I certainly wasn't asking
> for universal code that would work with any console.

Only to a degree.  Some consoles sniff the text sent to them for
particular URL-like patterns and linkify them for you.  All you have
to do is print a URL that its pattern-matching identifies:

  print("http://example.com")

However, as Rhodri details, *this is a feature of the terminal
emulator*. I've got a smattering of terminal emulators at my disposal
and many don't auto-linkify (xterm, rxvt, the base non-X terminal)
while others do (Gnome terminal).  And in the ones where it doesn't
work, it's because it's the *terminal* that doesn't support
linkifying, so no amount of work on the application's part will make
it linkify.

> The console is a dead thing, it has no mind or soul to choose
> anything. Surely an educated person would know that.

Pretty much every quality system administrator I know uses the
terminal.  Just about all of the best devs I know use the terminal.
Microsoft added Powershell because of demand. They added Ubuntu/bash
support because of demand.  It allows for powerful automation that
would otherwise require writing full-fledged scripts.  There is
nothing dead about it.

I'm not sure where you get your baseless claim that "an educated
person would know that", since someone who had taken the time to
study the state of terminal use would see that is far from dead.

-tkc





More information about the Python-list mailing list