Bug 476275

Summary: kde-open opens mistyped files as URLs
Product: [Frameworks and Libraries] frameworks-kio Reporter: armando.sano
Component: generalAssignee: KIO Bugs <kio-bugs-null>
Status: REPORTED ---    
Severity: normal CC: kdelibs-bugs-null
Priority: NOR    
Version First Reported In: 5.24.0   
Target Milestone: ---   
Platform: Kubuntu   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description armando.sano 2023-10-29 04:43:48 UTC
SUMMARY
When `kde-open` is called on an incomplete or mistyped file name, it attempts to open it as a URL

STEPS TO REPRODUCE
In Konsole, write `kde-open incomplete_filename`, where incomplete_filename is any incomplete or mistyped filename (and not a string containing 'http').

OBSERVED RESULT
Launches the default web browser and attempts to open the URL  `http://incomplete_filename`

EXPECTED RESULT
Write an error message and don't leave Konsole prompt.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Kubuntu 22.04 (live USB)
(available in About System)
KDE Plasma Version: 5.24.7
KDE Frameworks Version: 5.92.0
Qt Version: 5.15.3

ADDITIONAL INFORMATION
This situation occurs e.g. after partial auto-completion in terminal, when several files in a directory have the same base name but different extensions, as common with computer code, latex files etc. I'd like to be presented with an error message in terminal so I can complete the filename without the detour by Firefox, so to me this is a significant nuisance. 

`xdg-open` in KDE uses `kde-open`, so this behaviour is reproduced by `xdg-open` in KDE, but is absent in non-KDE distributions (i.a. Xubuntu). Developers of `xdg-utils` would like to know if this is expected behaviour from KIO (in which case they would fix it their end), or if this should be fixed in KIO. To me it sounds like the latter is more sensible as we shouldn't presume URLs that don't look like URLs?

I initially asked this on https://askubuntu.com/questions/1490165/prevent-xdg-open-to-open-mistyped-files-as-urls and then filed a bug at `xdg-utils` https://gitlab.freedesktop.org/xdg/xdg-utils/-/issues/233.

I tried this on a live Kubuntu 22.04 USB too, so the behaviour is independent of my configuration.

Thanks!