Hi,
Is there any way to capture the "context action"'s output? (And show it in the Messages tab, as for "Find in files".)
Is context_action_cmd=grep "%s" /some/dir (or similar, i.e. console commands) valid at all? (Currently does not seem to work.. Nothing happens..)
On Thu, 13 Sep 2018 at 01:42, e2qb2a44f@prolan-power.hu wrote:
Hi,
Is there any way to capture the "context action"'s output? (And show it in the Messages tab, as for "Find in files".)
Is context_action_cmd=grep "%s" /some/dir (or similar, i.e. console commands) valid at all? (Currently does not seem to work.. Nothing happens..)
Context actions do not collect the results of the subprocess nor monitor its completion, they are intended for external actions, the example given in the manual is opening a browser page for the selected item.
Custom commands substitute their output in the text, build commands show their output in the compiler window, but currently there is no user controllable command that shows its results in the message window.
Cheers Lex
--
Users mailing list Users@lists.geany.org https://lists.geany.org/cgi-bin/mailman/listinfo/users
Hi,
Lex Trotman:
Context actions do not collect the results of the subprocess
But if I have an xterm-like program (xfce4-terminal, under Xubuntu) then it can launch bash, bash can run the context action, and leave the window open, and show me the result.
I found that if I set the context action to
xfce4-terminal --tab --working-directory=/home/xxx/yyy/zzz -x bash -vc 'echo "%p" && grep -PIr "^using +%s +="; echo "--$?--" && read -sN1'
then the context action works and -- in my xfce4-terminal, in the last (new) tab -- I can inspect the results. (The action is, given a word zzz, to grep for "using zzz ="-like texts in directory (and below) /home/xxx/yyy/zzz.)
But:
- The context action does not know about "%p". I wish it would. Currently the action works only for this project (project's base dir is hardcoded).
- I have to leave Geany and switch to the xfce4-terminal window. (It does not even brings to front currently.) No integration. (In the Messages pane I could click on a line and Geany would open the file and seek to the line and highlight the word..)
build commands show their output in the compiler window
But:
- [The build commands] do not know about (recenty, and if I am correct) the %s wildcard. (Perhaps with a minimal effort, it could recognize it.)
On Fri, 14 Sep 2018 at 09:47, e2qb2a44f@prolan-power.hu wrote:
Hi,
Lex Trotman:
Context actions do not collect the results of the subprocess
But if I have an xterm-like program (xfce4-terminal, under Xubuntu) then it can launch bash, bash can run the context action, and leave the window open, and show me the result.
I found that if I set the context action to
xfce4-terminal --tab --working-directory=/home/xxx/yyy/zzz -x bash -vc 'echo "%p" && grep -PIr "^using +%s +="; echo "--$?--" && read -sN1'
then the context action works and -- in my xfce4-terminal, in the last (new) tab -- I can inspect the results. (The action is, given a word zzz, to grep for "using zzz ="-like texts in directory (and below) /home/xxx/yyy/zzz.)
Yes, the command can do anything.
But:
- The context action does not know about "%p". I wish it would. Currently the action works only for this project
(project's base dir is hardcoded).
Its possible, pull requests are welcome.
- I have to leave Geany and switch to the xfce4-terminal window. (It does not even brings to front currently.)
No integration. (In the Messages pane I could click on a line and Geany would open the file and seek to the line and highlight the word..)
build commands show their output in the compiler window
But:
- [The build commands] do not know about (recenty, and if I am correct) the %s wildcard. (Perhaps with a minimal
effort, it could recognize it.)
Selection is not really relevant to the main use-case of build commands, nonetheless a pull request may be accepted.
To reiterate my response above:
- context actions are intended to run commands that are not monitored by Geany
- build commands are intended to run commands that are monitored and parsed for compile errors and shown in the compile tab or to execute the built program and show its output in the built-in terminal or a separate terminal.
- custom commands are intended to be fed the selection via stdin and the output monitored and used to replace the selection
Your use-case is a command that is run and its output monitored and shown in the messages window, which is none of the above.
So as I said Geany does not currently support it. You could create an enhancement request, but I think it already exists.
Cheers Lex
--
Users mailing list Users@lists.geany.org https://lists.geany.org/cgi-bin/mailman/listinfo/users