Generalization of #27. From there:
The htop-dev team would like to see implemented is the functionality to start a $XDG_CONFIG_HOME/htop/run_script on a key press (possibly r):
run_script would be called with "PID" "USER" "COMMAND" on the currently highlighted line.
Bonus points for providing a sequence of "PID" "USER" "COMMAND" on stdin if multiple processes are tagged (=marked).
Bonus points for making the script location configurable in /etc/htoprc so that system-wide defaults could be set (having a $XDG_CONFIG_HOME/htop/run_script present would override the global setting still). This would (automatically) also allow to override the script location for a user in their local htoprc (same config reader).
If run_script outputs on stdout and/or stderr this would go into the InfoScreen pager. Otherwise htop would just return to normal operations once the exec* returns. See OpenFilesScreen.c or TraceScreen.cfor inspiration.
Attaching a gdb could be a htop-supplied example of how to use such a script.
Generalization of #27. From there:
The htop-dev team would like to see implemented is the functionality to start a
$XDG_CONFIG_HOME/htop/run_scripton a key press (possibly r):run_scriptwould be called with "PID" "USER" "COMMAND" on the currently highlighted line.Bonus points for providing a sequence of "PID" "USER" "COMMAND" on stdin if multiple processes are tagged (=marked).
Bonus points for making the script location configurable in
/etc/htoprcso that system-wide defaults could be set (having a$XDG_CONFIG_HOME/htop/run_scriptpresent would override the global setting still). This would (automatically) also allow to override the script location for a user in their localhtoprc(same config reader).If
run_scriptoutputs on stdout and/or stderr this would go into theInfoScreenpager. Otherwise htop would just return to normal operations once theexec*returns. SeeOpenFilesScreen.corTraceScreen.cfor inspiration.Attaching a gdb could be a htop-supplied example of how to use such a script.