Bug 423412 - Dolphin can't properly run script if there is space in the path
Summary: Dolphin can't properly run script if there is space in the path
Alias: None
Product: frameworks-kio
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: 5.71.0
Platform: Neon Linux
: NOR normal
Target Milestone: ---
Assignee: KIO Bugs
Keywords: regression
: 423578 423701 (view as bug list)
Depends on:
Reported: 2020-06-23 21:44 UTC by Alex Fliker
Modified: 2020-07-08 17:00 UTC (History)
7 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.72

possible fix (435 bytes, patch)
2020-06-24 19:22 UTC, Tobias Klausmann

Note You need to log in before you can comment on or make changes to this bug.
Description Alex Fliker 2020-06-23 21:44:13 UTC
1. Have a path like '/storage/Programs/Astronomy/ISS Transit Predictor'
2. Launch a script in this directory by choosing Execute when prompted

Nothing happens. Clue is given by running Dolphin in terminal: '/bin/sh: 1: /storage/Programs/Astronomy/ISS: not found'

Properly handling the path containing the space and executing the script

Operating System: KDE neon 5.19
KDE Plasma Version: 5.19.1
KDE Frameworks Version: 5.71.0
Qt Version: 5.14.2
Kernel Version: 5.4.0-38-generic
OS Type: 64-bit
Comment 1 Tobias Klausmann 2020-06-24 10:36:35 UTC
I can confirm this behavior and noting that this worked in previous releases, so its most likely a recent regression

/Wine/Program Files/test.sh ->
/bin/sh: /Wine/Program: Datei oder Verzeichnis nicht gefunden

Operating System: openSUSE Tumbleweed
KDE Plasma Version: 5.19.1
KDE Frameworks Version: 5.71.0
Qt Version: 5.15.0
Comment 2 Tobias Klausmann 2020-06-24 19:22:38 UTC
Created attachment 129642 [details]
possible fix

While debugging i found this to involve several components (Dolphin, kio, kcoreaddons), yet the seemingly easiest solution seems to be in kios CommandLauncherJob. A diff to fix the described regression is attached (I know this is not the way to upstream patches, yet i wanted it to discuss first)
Comment 3 Nate Graham 2020-06-24 21:05:55 UTC
Nice. Looks like a sensible fix to me. BTW submitting directly is often the best way to have that discussion, so please submit it over here: https://invent.kde.org/frameworks/kio/-/merge_requests/

In your commit message, you can add `Bug: 423412` on its own line and it will automatically close this when merged.
Comment 4 Bug Janitor Service 2020-06-28 22:48:40 UTC
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/kio/-/merge_requests/69
Comment 5 Ahmad Samir 2020-06-29 09:59:31 UTC
Git commit 8d6b306f585920230acecd19903325f6f0387b8e by Ahmad Samir, on behalf of David Faure.
Committed on 29/06/2020 at 09:58.
Pushed by ahmadsamir into branch 'master'.

OpenUrlJob: fix support for shell scripts with a space in the filename

When executing a shell script or an executable in dolphin in a folder with a blank
e.g. "/my test/test.sh" the path was truncated to "/my" and the command was not executed.

Document the API trap.
Related: bug 423645
FIXED-IN: 5.72

M  +2    -0    src/gui/commandlauncherjob.h
M  +1    -1    src/gui/openurljob.cpp

Comment 6 Nate Graham 2020-07-02 01:18:14 UTC
*** Bug 423701 has been marked as a duplicate of this bug. ***
Comment 7 Ahmad Samir 2020-07-08 17:00:28 UTC
*** Bug 423578 has been marked as a duplicate of this bug. ***