Created attachment 150381 [details] External Tools configuration When I am trying to point to the External Tools' executable using %{ENV:HOME}/Application/... that tool is disappearing from the menu. I can bring it back using full path: /Users/pawelp/Application/... See the attachement. SOFTWARE/OS VERSIONS macOS ADDITIONAL INFORMATION Build from sources
What path does mouse-over show you over the line edit? At first glance I can't spot anything wrong. However: the tool is only listed in the nenu, if the executable exists. It seems that this test maybe does not properly expand the variables?!
Code to check for the exe: https://invent.kde.org/utilities/kate/-/blob/master/addons/externaltools/kateexternaltool.cpp#L127 The variable hasexec is used here: https://invent.kde.org/utilities/kate/-/blob/master/addons/externaltools/kateexternaltoolsview.cpp#L71 And hasexec is set to checkExec on load here: https://invent.kde.org/utilities/kate/-/blob/master/addons/externaltools/kateexternaltool.cpp#L154 That is a bug. Caching in in hasexec is a bad idea. Instead, checkExec should expand the variable on the fly.
Created attachment 150532 [details] Env:Home value in edit field
A possibly relevant merge request was started @ https://invent.kde.org/utilities/kate/-/merge_requests/1108
Git commit 74c459c3780dab24d39044ccb27f83aaf48e8e83 by Waqar Ahmed. Committed on 20/02/2023 at 11:52. Pushed by waqar into branch 'master'. ExternalTools: Fix tools with variables in their exec are ignored We can't hasexec on load as noted in the bugreport. Instead we can just when the tool is exectued and its variables have been expanded that it exists or not. If it doesn't exist, we show a message to the user FIXED-IN: 23.04 M +18 -2 addons/externaltools/externaltoolsplugin.cpp M +1 -1 addons/externaltools/kateexternaltool.cpp M +14 -1 addons/externaltools/kateexternaltool.h M +1 -1 addons/externaltools/kateexternaltoolsconfigwidget.cpp M +3 -1 addons/externaltools/kateexternaltoolsview.cpp https://invent.kde.org/utilities/kate/commit/74c459c3780dab24d39044ccb27f83aaf48e8e83