ggreer / the_silver_searcher

A code-searching tool similar to ack, but faster.

Home Page:http://geoff.greer.fm/ag/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

feat: include OSC8 escape codes in output

WhyNotHugo opened this issue · comments

commented

In recent times, terminals have adopted a feature which allows clients to indicate that a given portion of text is a hyperlink. See: https://github.com/Alhadis/OSC8-Adoption/ and https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3cb5feda

This links can use the file:// scheme to point to local files.

If ag included these escape codes in its output, this could be very useful for quickly interacting with results:

  • Keyboard driven terminals usually have a shortcut to open such links very quickly.
  • Mouse/touch oriented terminals would allow users to click/tap of files in results and interact with them.

How the files themselves are opened after human interaction depends on the terminal implementation and its configuration, so it mostly out of scope here.