Bug 483297 - ls --hyperlink links (file URLs with a host name) do not work
Summary: ls --hyperlink links (file URLs with a host name) do not work
Status: CONFIRMED
Alias: None
Product: konsole
Classification: Applications
Component: general (show other bugs)
Version: 24.12.1
Platform: Fedora RPMs Linux
: NOR normal
Target Milestone: ---
Assignee: Konsole Developer
URL: https://bugs.gentoo.org/941194
Keywords:
Depends on:
Blocks:
 
Reported: 2024-03-11 22:14 UTC by derikson3
Modified: 2025-01-22 14:57 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description derikson3 2024-03-11 22:14:34 UTC
SUMMARY

GNU coretils outputs file URLs with a hostname when using "ls --hyperlink", e.g. "file://myhost/tmp".  Clicking links like these does nothing, but if the host name is removed they work.

STEPS TO REPRODUCE

1. Edit the current profile and turn on "Allow escape sequences for links"
2. ls --hyperlink
3. ctl + click a file or directory

or

1. echo file://$(hostname)/tmp
2. ctl + click the output

or

1. echo file://localhost/tmp
2. ctl + click the output

OBSERVED RESULT

Nothing happens.

EXPECTED RESULT

The file or directory is opened in the correct application.
This does work properly for file:///tmp , but doesn't work for file://localhost/tmp . It also works for file://tmp , which it probably shouldn't

SOFTWARE/OS VERSIONS

Linux: 6.5.0
KDE Plasma Version: 5.27.8
KDE Frameworks Version: 5.110.0
Qt Version: 5.15.10
Comment 1 Yury V. Zaytsev 2025-01-22 14:57:00 UTC
Hello,

I'm the maintainer of Midnight Commander. We have recently started emitting OSC 7 sequences with "file://" information about the current directory to the terminal. We emit host information, because this way the terminal can discern, whether or not the link pertains to the current host (or is, for example, pointing to a machine on the ssh connection).

Unfortunately, Konsole (I've checked the latest on Fedora 41) doesn't properly parse host information and forwards the host part to Dolphin. In turn, Dolphin fails to start reporting that "/host/foo/bar" is not a valid path.

If we remove the host from the sequence, then Konsole handles it correctly. However, the presence of the host is standard-compliant (see https://datatracker.ietf.org/doc/html/rfc8089) and we also don't want to lose the advantage of distinguishing the hosts as noted above. Other terminal emulation engines (VTE) seem to be able to handle the host just fine. I would appreciate if you could please fix Konsole as well.

A similar bug was recently reported against LibreOffice and fixed there: https://bugs.documentfoundation.org/show_bug.cgi?id=107461 .
Our bug report can be found here: https://midnight-commander.org/ticket/4614 .
Gentoo bug report can be found here: https://bugs.gentoo.org/941194 .

Many thanks!

All the best,
Yury