Bug 455117 - Global shortcut launches terminal application without a terminal
Summary: Global shortcut launches terminal application without a terminal
Status: RESOLVED FIXED
Alias: None
Product: frameworks-kglobalaccel
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: 5.94.0
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: kdelibs bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-06-10 09:58 UTC by Jin Liu
Modified: 2022-07-09 17:56 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.95


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jin Liu 2022-06-10 09:58:14 UTC
SUMMARY
When a shortcut is assigned to a terminal application (e.g. fish, htop) in the menu editor, pressing that shortcut will launch the application without a terminal, despite the menu item specifies "Run in terminal". 

STEPS TO REPRODUCE
1. Open menu editor
2. Select htop
3. Assign shortcut "Meta-H"
4. Press Meta-H

OBSERVED RESULT
Nothing visible.
journalctl shows:
kglobalaccel5: Error opening terminal: unknown

EXPECTED RESULT
htop opens in a terminal

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 5.24.90
KDE Frameworks Version: 5.94.0 
Qt Version: 5.15.4
Comment 1 Jin Liu 2022-06-10 09:59:51 UTC
BTW, the "Error opening terminal: unknown" message is printed by htop, when run without a terminal.
Comment 2 Bug Janitor Service 2022-06-10 13:00:48 UTC
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/kglobalaccel/-/merge_requests/47
Comment 3 Ahmad Samir 2022-06-12 17:50:05 UTC
Wrong tab, sorry.
Comment 4 Ahmad Samir 2022-07-02 12:26:31 UTC
Git commit b72930eb075a79ff89e8db221749de978706e5bf by Ahmad Samir, on behalf of Jin Liu.
Committed on 02/07/2022 at 12:26.
Pushed by ahmadsamir into branch 'master'.

Launch app in terminal when Terminal=true

When the desktop file has Terminal=true (e.g. htop), it should be
launched in a terminal.

Instead of calling "kstart5 -- <exec path>", this calls
"kstart5 --application <desktop file name>" when and only when:
1. kstart5 is available
2. the desktop file is in XDG_DATA_HOME/applications/,
not XDG_DATA_HOME/kglobalaccel/
3. we are launching the desktop file's main group, not other actions

M  +35   -16   src/runtime/kserviceactioncomponent.cpp
M  +3    -0    src/runtime/kserviceactioncomponent.h

https://invent.kde.org/frameworks/kglobalaccel/commit/b72930eb075a79ff89e8db221749de978706e5bf