Summary: | Launch configuration arguments are not fully passed when executing (escaped) | ||
---|---|---|---|
Product: | [Applications] kdevelop | Reporter: | Gerald Senarclens de Grancy <oss> |
Component: | general | Assignee: | kdevelop-bugs-null |
Status: | CONFIRMED --- | ||
Severity: | minor | CC: | gernotfasch, igorkuo, oss |
Priority: | NOR | ||
Version First Reported In: | 5.12.230801 | ||
Target Milestone: | --- | ||
Platform: | Kubuntu | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: | |||
Attachments: | 5 screenshots showing the problem and a workaround |
Description
Gerald Senarclens de Grancy
2024-04-24 10:39:05 UTC
I was able to reproduce the problem with version: 5.13.240202 , however the run window shows: *** Failed to specify program to start: *** I think the user is responsible for quoting or escaping problematic arguments manually. If KDevelop quotes the string automatically, passing multiple arguments becomes impossible. If KDevelop escapes special characters automatically, quoted or already escaped arguments in existing user configurations would break. True that existing configurations that work around the problem would break by fixing this issue. Not sure how many people this would affect. For new users, the current behavior is misleading as they're defining cli arguments and should be able to presume that they are passed to the cli as if they were typed in a konsole window. A possible alternative to using the argument text input as a raw string would be to add a proper help message telling the user which characters require escaping. launch_window.png shows the argument as capitalize, without square brackets. Is this a screenshot mistake? Is escaping the only working solution or does quoting the argument work too? (In reply to Gerald Senarclens de Grancy from comment #3) > A possible alternative to using the argument text input as a raw string > would be to add a proper help message telling the user which characters > require escaping. Feel free to implement the help message (as a tooltip perhaps) and create a merge request at https://invent.kde.org/kdevelop/kdevelop/-/merge_requests Just tested: quoting works as well as escaping, so the issue is not too bad. Perhaps the UI should show an error message earlier - before the user attempts to actually run the program, because the problem is localized in the value of the Arguments line edit. The relevant code was implemented in 2009 by https://commits.kde.org/kdevelop/fd240820495a98ff30b61af3476e0e5bc6fcd606. The code currently resides in https://invent.kde.org/kdevelop/kdevelop/-/blob/c8417fc2baf2ecba70e7e2b474fa2d00b1970265/plugins/execute/executeplugin.cpp#L62. The job of splitting arguments is fully delegated to KShell::splitArgs(cmd, KShell::TildeExpand | KShell::AbortOnMeta, err). Its documentation: https://api.kde.org/frameworks/kcoreaddons/html/namespaceKShell.html#a2af8a3c7f2b485868a1169f4de07a050. The documentation for the AbortOnMeta flag suggests it is the culprit, and indeed removing the flag makes unquoted and unescaped square brackets work. I don't know whether removing this flag is going to break something else though. Needs a more detailed analysis and careful testing. Thanks for your investigation Igor! When vacation time starts I'll have another look and will attempt a MR if I can up with a reasonable improvement. |