Bug 456570

Summary: "Run current document" fails if path contains spaces
Product: [Applications] kate Reporter: mittbrukernavn
Component: generalAssignee: KWrite Developers <kwrite-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: a.samirh78, christoph
Priority: NOR Keywords: usability
Version First Reported In: 22.04.2   
Target Milestone: ---   
Platform: Manjaro   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: python with shebang
.sh without shebang

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