chiark / gitweb /
terminal: add internal API to format URLs for display in capable terminals
authorLennart Poettering <lennart@poettering.net>
Thu, 19 Apr 2018 15:48:53 +0000 (17:48 +0200)
committerSven Eden <yamakuzure@gmx.net>
Fri, 24 Aug 2018 14:47:08 +0000 (16:47 +0200)
commit15f9c17dd3ccf9dc21ceb795feb27a6b6dee1b1f
treeb65445fe5295a64278fd00efd0f0a1ea9b443091
parent536b23f78a8668907e5e0f59f39c81126308eeee
terminal: add internal API to format URLs for display in capable terminals

Newer terminals (in particular gnome-terminal) understand special escape
sequence for formatting clickable links. Let's support that to make our
tool output more clickable where that's appropriate.

For details see this:

https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3cb5feda

The one big issue is that 'less' currently doesn't grok this, and
doesn't ignore sequence like regular terminal implementations do if they
don't support it. Hence for now, let's disable URL output if a pager is
used. We should revisit that though as soon as less added support for it
and enough time passed for it to enter various distributions.
man/elogind.xml
src/basic/terminal-util.c
src/basic/terminal-util.h