I had a problem with execution of
(comint-simple-send process command). My previous example would not show the last output because I didn't use the hook and the result was being dispalyed before the command finished it's execution. Als I didn't know about having to restart the process to reflect the code changes.
The following code works.
(add-hook 'comint-output-filter-functions '(lambda (txt) (message (format " output ----------- %c%s" 10 txt)))) (let* ((process-buffer (make-comint-in-buffer "StrangeTerm" "*strange-term*" "/bin/bash")) (p (get-buffer-process process-buffer))) (comint-simple-send p "ls -l /"))
The lambda has the expected output, which I can see in Messages and in future I can do what I want with it.
Please confirm if this is the correct approach.