Bug 495551 - Can't execute desktop files/scripts in Konsole Flatpak
Summary: Can't execute desktop files/scripts in Konsole Flatpak
Status: CONFIRMED
Alias: None
Product: frameworks-kio
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: git master
Platform: Flatpak Linux
: NOR normal
Target Milestone: ---
Assignee: KIO Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-10-29 21:58 UTC by Nate Graham
Modified: 2024-10-30 15:14 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 Nate Graham 2024-10-29 21:58:46 UTC
STEPS TO REPRODUCE
1. Install Konsole from Flathub, and don't install it from your distro (or uninstall it).
2. Create a tiny .desktop file that runs a terminal command, like this:

[Desktop Entry]
Exec=speak-ng hello
Name=Say something
Icon=kmouth
Type=Application
Terminal=true

3. Launch it.

OBSERVED RESULT
An error message saying "Terminal konsole not found while trying to run [path to file]"


EXPECTED RESULT
Konsole opens, the speakers play "hello", and then Konsole closes


ADDITIONAL INFORMATION
System Settings > Default Applications shows "Konsole" as the default terminal app.

The fact that the error message says "konsole" and not "Konsole" leads me to believe that it's trying to run the `konsole` executable, which won't work for a Flatpak app.
Comment 1 Nicolas Fella 2024-10-30 11:59:20 UTC
relevant code is at https://invent.kde.org/frameworks/kio/-/blob/master/src/core/desktopexecparser.cpp#L491

It doesn't handle this correctly, it should be looking up terminal apps by desktop entry name, not command.

KTerminalLauncherJob handles this much better: https://invent.kde.org/frameworks/kio/-/blob/master/src/gui/kterminallauncherjob.cpp#L85
Comment 2 Nate Graham 2024-10-30 14:54:19 UTC
Would it make sense to port it to use KTerminalLauncherJob directly?
Comment 3 Nicolas Fella 2024-10-30 15:13:43 UTC
Maybe. Or extract the relevant part of it into a shared function