From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Emacs support for --hyperlink in ls? Date: Tue, 03 May 2022 14:35:32 +0300 Message-ID: <83mtfy4znf.fsf@gnu.org> References: <8735hqdflj.fsf@cam.ac.uk> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="32956"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Stephen Eglen Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue May 03 13:37:34 2022 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nlqqT-0008Q4-PF for ged-emacs-devel@m.gmane-mx.org; Tue, 03 May 2022 13:37:34 +0200 Original-Received: from localhost ([::1]:41674 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nlqqS-00006G-FL for ged-emacs-devel@m.gmane-mx.org; Tue, 03 May 2022 07:37:32 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:37420) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nlqoL-0007b7-8H for emacs-devel@gnu.org; Tue, 03 May 2022 07:35:21 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:52416) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nlqoK-0001Go-Qf; Tue, 03 May 2022 07:35:20 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=tM8gFm5mdlFRfSkZ4Uy/L6vLMrqD9/XGOdnV+hUuD9E=; b=My0IEaPi35LN Q7pzOB1pb2Eyvq4AApcv1BsyW8w29jHLtWDRj10Iy5KPs+4qhQP3ba3p2ZFglkJV+c0dZSL8poim/ rWzyWfS8wXITBIdrI4d8jOSDxaxrob2Kf3XEjsq/B3melGPPqA+UxY5kY4u3L+NsyOVlAYjJP15WN +7vk9B/Yo4DevrcPhiHgHyTvUwuXK4AZusQ7RcLa2Izp5Laq8s5WoEaHbaczEZX01wxn3B4WT+Qxb vHp4j4k/vM7gXKYVeviQ91OI0coKsURcH9gIK0pQLMWm0UwQ8aaamL5iZPdJ+tS4iqnPtTKWSQduN IWAXWvX+Y3zkkNMs7F//6g==; Original-Received: from [87.69.77.57] (port=2515 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nlqoK-0004sP-9C; Tue, 03 May 2022 07:35:20 -0400 In-Reply-To: <8735hqdflj.fsf@cam.ac.uk> (message from Stephen Eglen on Tue, 03 May 2022 12:08:30 +0100) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:289104 Archived-At: > From: Stephen Eglen > Date: Tue, 03 May 2022 12:08:30 +0100 > > 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/acpiacpi%1b]8;; > %1b]8;;file://light/etc/adjtimeadjtime%1b]8;; > %1b]8;;file://light/etc/alsaalsa%1b]8;; > %1b]8;;file://light/etc/anacrontabanacrontab%1b]8;; > %1b]8;;file://light/etc/ant.confant.conf%1b]8;; > > 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? comint.el already supports OSC 8, since Emacs 28.