From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stephen Eglen Newsgroups: gmane.emacs.devel Subject: Emacs support for --hyperlink in ls? Date: Tue, 03 May 2022 12:08:30 +0100 Message-ID: <8735hqdflj.fsf@cam.ac.uk> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="13935"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: mu4e 1.6.10; emacs 28.1 To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue May 03 13:34:00 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 1nlqn2-0003RU-K9 for ged-emacs-devel@m.gmane-mx.org; Tue, 03 May 2022 13:34:00 +0200 Original-Received: from localhost ([::1]:39162 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nlqn1-0006c7-Da for ged-emacs-devel@m.gmane-mx.org; Tue, 03 May 2022 07:33:59 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:33252) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nlqdP-0006EJ-5Z for emacs-devel@gnu.org; Tue, 03 May 2022 07:24:07 -0400 Original-Received: from ppsw-40.csi.cam.ac.uk ([131.111.8.140]:42042) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nlqdM-0007OV-8l for emacs-devel@gnu.org; Tue, 03 May 2022 07:24:02 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=cam.ac.uk; s=20210802.ppsw; h=Content-Type:MIME-Version:Message-ID:Date:Subject:To:From: Sender:Reply-To:Cc:Content-Transfer-Encoding:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=jeL6gtNMv8E/fkYYBhDPe55h+EHD+sldyD9ZkyNC1LA=; b=YtOfdMCF66N9dk9Cye1gGQaHcv YFwC6MElwP8535WcXOBeth7n/zKvl9yfXOYxYTE/QHOoIJbTRwBrBvCLdWN41ItwiJm+QHsgjPhpy t6d9rd0K1RUROMRkmjLyR/QAZPA+kx0yovGWeRnZMGsBSvDDnrAF5eDiyMqKJ/yJHSBo=; X-Cam-AntiVirus: no malware found X-Cam-ScannerInfo: https://help.uis.cam.ac.uk/email-scanner-virus Original-Received: from smtp.maths.cam.ac.uk ([131.111.20.158]:51577 helo=evander.maths.cam.ac.uk) by ppsw-40.csi.cam.ac.uk (ppsw.cam.ac.uk [131.111.8.138]:25) with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) id 1nlqdG-000InX-k8 (Exim 4.95) for emacs-devel@gnu.org (return-path ); Tue, 03 May 2022 12:23:54 +0100 Original-Received: from 36.224.115.87.dyn.plus.net ([87.115.224.36] helo=localhost) by evander.maths.cam.ac.uk with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1nlqdF-008NZx-OU for emacs-devel@gnu.org; Tue, 03 May 2022 12:23:53 +0100 Received-SPF: pass client-ip=131.111.8.140; envelope-from=sje30@cam.ac.uk; helo=ppsw-40.csi.cam.ac.uk X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_MED=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Tue, 03 May 2022 07:32:11 -0400 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:289103 Archived-At: 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? Stephen