unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Stephen Eglen <sje30@cam.ac.uk>
To: emacs-devel@gnu.org
Subject: Emacs support for --hyperlink in ls?
Date: Tue, 03 May 2022 12:08:30 +0100	[thread overview]
Message-ID: <8735hqdflj.fsf@cam.ac.uk> (raw)

Various programs, including ls (GNU coreutils 9.0), now contain
--hyperlink flag and similar to markup file names with the full
file-path.  The full file name is embedded using 'OSC 8 escape sequence'
so that it can be hidden in terminal emualators and recognised as a hyperlink.

For a video example using the kitty terminal, see

https://download.calibre-ebook.com/videos/kitty.mp4

the relevant part starts about 3min in; several other terminals also
support this feature.  Further documentation of this feature is on the
following page

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

Should Emacs support these OSC 8 hyperlinks in things like *shell*?

If I run M-x shell, of course, these hyperlinks appear verbatim.

$ ls -1 --hyperlink /etc | head -5

%1b]8;;file://light/etc/acpi\aacpi%1b]8;;\a
%1b]8;;file://light/etc/adjtime\aadjtime%1b]8;;\a
%1b]8;;file://light/etc/alsa\aalsa%1b]8;;\a
%1b]8;;file://light/etc/anacrontab\aanacrontab%1b]8;;\a
%1b]8;;file://light/etc/ant.conf\aant.conf%1b]8;;\a

If people think it worth trying, I might start hacking something to work
e.g. on comint-output-filter-functions but presumably this might be
something that eshell, ansi-term and vterm might also benefit from?

Stephen



             reply	other threads:[~2022-05-03 11:08 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-03 11:08 Stephen Eglen [this message]
2022-05-03 11:35 ` Emacs support for --hyperlink in ls? Eli Zaretskii
2022-05-03 20:38   ` Stephen Eglen
2022-05-04  5:48     ` Eli Zaretskii
2022-05-06 12:17       ` Augusto Stoffel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8735hqdflj.fsf@cam.ac.uk \
    --to=sje30@cam.ac.uk \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).