Bug 456570 - "Run current document" fails if path contains spaces
Summary: "Run current document" fails if path contains spaces
Status: RESOLVED FIXED
Alias: None
Product: kate
Classification: Applications
Component: general (show other bugs)
Version: 22.04.2
Platform: Manjaro Linux
: NOR normal
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords: usability
Depends on:
Blocks:
 
Reported: 2022-07-11 01:12 UTC by mittbrukernavn
Modified: 2022-07-23 16:31 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
python with shebang (26.65 KB, image/png)
2022-07-11 01:12 UTC, mittbrukernavn
Details
.sh without shebang (19.69 KB, image/png)
2022-07-11 01:40 UTC, mittbrukernavn
Details

Note You need to log in before you can comment on or make changes to this bug.
Description mittbrukernavn 2022-07-11 01:12:26 UTC
Created attachment 150528 [details]
python with shebang

STEPS TO REPRODUCE
1. create a directory containing a space
2. create any executable file inside it
3. tools>Run Current Document

OBSERVED RESULT
Kate's console-module outputs that the path is not valid and displays space-broken filepath

SOFTWARE/OS VERSIONS
Manjaro Ruah 21.3.2
Plasma vers.: 5.24.5
Qt vers.: 5.15.5  

ADDITIONAL INFORMATION
Sorry if this is a duplicate, it is basically the same as this:
https://bugs.kde.org/show_bug.cgi?id=443618

It's no real biggie since copy file path and pasting works just fine. 

Anyways: Thank you for a wonderful editor,  all your hard work and valuable contributions to the linux ecosystem!
Comment 1 mittbrukernavn 2022-07-11 01:40:02 UTC
Created attachment 150530 [details]
.sh without shebang
Comment 2 Waqar Ahmed 2022-07-21 12:29:02 UTC
Git commit 32cfd88152fdd501a79a60fb1e1f6ff3a06d1d83 by Waqar Ahmed.
Committed on 21/07/2022 at 12:28.
Pushed by waqar into branch 'master'.

Konsole: Wrap file name into quotes

Filenames can contain spaces

M  +2    -2    addons/konsole/kateconsole.cpp

https://invent.kde.org/utilities/kate/commit/32cfd88152fdd501a79a60fb1e1f6ff3a06d1d83
Comment 3 Christoph Cullmann 2022-07-21 16:10:43 UTC
Hmm, I see that this is already a lot better, is there no real escape function we could use, given this will still do strange stuff if the path contains quotes itself?
Comment 5 Christoph Cullmann 2022-07-21 19:42:52 UTC
Git commit 4a10f068ea243efdc64fd6df2e8e149f2aa813f1 by Christoph Cullmann, on behalf of Waqar Ahmed.
Committed on 21/07/2022 at 19:42.
Pushed by cullmann into branch 'release/22.08'.

Konsole: Wrap file name into quotes

Filenames can contain spaces

M  +2    -2    addons/konsole/kateconsole.cpp

https://invent.kde.org/utilities/kate/commit/4a10f068ea243efdc64fd6df2e8e149f2aa813f1
Comment 6 Ahmad Samir 2022-07-23 15:10:09 UTC
Git commit 8e45d772753fb8fc5a2bb2abb1875e9c891df10a by Ahmad Samir.
Committed on 23/07/2022 at 13:43.
Pushed by cullmann into branch 'master'.

Konsole plugin: quote args before passing them to the shell

An alternative fix for 456570

M  +5    -8    addons/konsole/kateconsole.cpp

https://invent.kde.org/utilities/kate/commit/8e45d772753fb8fc5a2bb2abb1875e9c891df10a
Comment 7 Christoph Cullmann 2022-07-23 16:31:05 UTC
Git commit a59494709cc4e8e3415fa7ad88c9e505c89e9547 by Christoph Cullmann, on behalf of Ahmad Samir.
Committed on 23/07/2022 at 16:30.
Pushed by cullmann into branch 'release/22.08'.

Konsole plugin: quote args before passing them to the shell

An alternative fix for 456570

M  +5    -8    addons/konsole/kateconsole.cpp

https://invent.kde.org/utilities/kate/commit/a59494709cc4e8e3415fa7ad88c9e505c89e9547