The specific problem I'm trying to solve is
- send a command to a running
telnetsession - echo the result of the command with
message
But the general problem is sending a command to an inferior (comint) process and waiting for output to come back and a new prompt to appear, and return the output.
I have:
(defun dired-vlc-test ()
(interactive)
(let* ((buf (process-buffer dired-vlc-telnet-proc))
(old-max (with-current-buffer buf
(point-max))))
(telnet-simple-send dired-vlc-telnet-proc "get_time")
(accept-process-output dired-vlc-telnet-proc 5)
(message (buffer-substring-no-properties old-max (with-current-buffer buf
(point-max))))))
However the output I always get is "get_time", i.e. Emacs is not waiting for new output.
I got the accept-process-output idea from this question