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.
My solution
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.
ansi-termforls ~/Desktop? Can't you usedirectory-filesorshell-commandorasync-shell-command? (The latter two if thels ~/Desktopis just an example of what you want to do.) – Tobias Jan 13 '17 at 17:36term-modeis based on comint but it does not use it. – Tobias Jan 13 '17 at 19:11strange-term. Just use text properties to identify boundaries (put-text-propertyis your friend). You can even put text properties on newline characters. – Tobias Jan 13 '17 at 23:41