Subject: bug#55261: file:// links geneated by --hyperlink

From: Stephen Eglen <[email-masked]>
Date: Wed, 04 May 2022 14:27:11 +0100

hi,

With ls (GNU coreutils) 9.0 if I generate a hyperlink e.g.:

$ ls --hyperlink /etc/anacrontab

it generates the following filename (after removing the markup)

file://light/etc/anacrontab

where 'light' is the name of my laptop (running arch linux).
browse-url-xdg-open is my browser-function, and

$ xdg-open file://light/etc/anacrontab

generates the error:

xdg-open: file 'file://light/etc/anacrontab' does not exist

As the file URI is local, I think it might be a mistake to include the
machine name, light, unless it is a FQDN.  If I edit the URL to remove
'light' the link works as expected.

This was reported for kitty terminal last year and fixed by dropping the
hostname: https://github.com/kovidgoyal/kitty/issues/2970

However, kitty seems to be able to connect to machines remotely via
ssh  ( https://download.calibre-ebook.com/videos/kitty.mp4 ) and so
maybe having the domain name in the hyperlink is useful.   

Stephen