Bug 483180 - Build plugin: Working directory variables are not replaced when executing "Run command"
Summary: Build plugin: Working directory variables are not replaced when executing "Ru...
Status: RESOLVED FIXED
Alias: None
Product: kate
Classification: Applications
Component: general (show other bugs)
Version: 24.02.0
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-03-10 22:41 UTC by kde
Modified: 2024-03-15 18:01 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description kde 2024-03-10 22:41:54 UTC
SUMMARY
Placeholder variables (like %B) are not replaced when the "Run command" is executed.

STEPS TO REPRODUCE
1. Set Working Directory to %B
2. Set a run command relative to the project dir
3. Click the "Build and run target" button

OBSERVED RESULT
The terminal has the users home directory as the current directory

EXPECTED RESULT
The working directory should be the same as for the build command.

The variables should be replaced in every code path that uses the working directory.

ADDITIONAL INFORMATION
KateBuildView::slotRunAfterBuild() takes the working directory as is, whereas KateBuildView::buildCurrentTarget() replaces the variables.
KateBuildView::buildCurrentTarget() also does not replace the variables if the "Build command" is empty.
Comment 1 Kåre Särs 2024-03-11 09:13:10 UTC
Thanks for the report!

You seem to have looked at the code already. Do you want to scratch your itch and create a merge request?


If not, I'll add it to my todo
Comment 2 kde 2024-03-11 16:24:27 UTC
I created a merge request: https://invent.kde.org/utilities/kate/-/merge_requests/1419
Comment 3 Christoph Cullmann 2024-03-15 18:01:34 UTC
fixed with https://invent.kde.org/utilities/kate/-/merge_requests/1419