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-term
forls ~/Desktop
? Can't you usedirectory-files
orshell-command
orasync-shell-command
? (The latter two if thels ~/Desktop
is just an example of what you want to do.)term-mode
is based on comint but it does not use it.