[konsole] [Bug 483297] ls --hyperlink links (file URLs with a host name) do not work
Ben Morris
bugzilla_noreply at kde.org
Sat Jun 14 21:43:34 BST 2025
https://bugs.kde.org/show_bug.cgi?id=483297
Ben Morris <bugs at benmorris.org.uk> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |bugs at benmorris.org.uk
--- Comment #2 from Ben Morris <bugs at benmorris.org.uk> ---
I'd just like to add a few details to this: a more reliable repro, a document
showing what Konsole should do, and a possible explanation for what it
currently does.
The following steps to reproduce are modified to ensure that Konsole's own
filename detection feature does not interfere:
1. Enable "Allow escape sequences for links", in the current console profile.
2. $ touch ~/Documents/example.txt
3. $ (cd ~/Documents/ && ls --hyperlink=always example.txt)
4. Ctrl+click on "example.txt".
Konsole should open example.txt in a text editor, but instead it pops up a
dialog which says:
> The file or folder //[your hostname]/home/[your username]/Documents/example.txt does not exist.
The following page states that ls is doing the correct thing, and file:// URLs
produced using OSC 8 escape sequences should always have a hostname component.
https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3cb5feda#file-uris-and-the-hostname
Is this actually exposing a bug in KIO? It appears to have special handling for
the current hostname, along with "localhost", in file:// URLs, but this special
handling does not do the right thing:
$ kioclient stat file://localhost/etc
kioclient: The file or folder //localhost/etc does not exist.
$ kioclient stat file://otherhost/etc
kioclient: The file or folder smb://otherhost/etc does not exist.
Other hostnames cause the URL to be treated as smb:// URLs, while "localhost"
and the system's own hostname are handled specially. However, somehow, the way
in which they are handled specially is that they are converted to directory
names.
This has the curious consequence that you can "fix" hyperlinks in Konsole by
doing `sudo ln -s / /$(hostname)`. I am not recommending this as a solution -
I'm using it as a demonstration that the hostname really is being interpreted
as a directory name.
--
You are receiving this mail because:
You are the assignee for the bug.
More information about the konsole-devel
mailing list