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!
Created attachment 150530 [details] .sh without shebang
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
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?
There is KShell::quoteArg() https://api.kde.org/frameworks/kcoreaddons/html/namespaceKShell.html#a471161f0b7fb9b516932d2a9121c715b
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
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
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